带有Phonegap Build的Cordova Plugin Whitelist不适用于iOS

时间:2017-01-19 23:05:41

标签: cordova-plugins phonegap-build

我使用cordova-plugin-whitelist(v 1.3.1)和我的cordova应用程序。 我的config.xml中有一条规则

<allow-intent href="tel:*"/>

我的应用中的代码如下所示:

window.open('tel:2065551212');

如果我在本地构建并部署到应用商店,则代码在android和ios上都能正常工作。

如果我使用Adobe的Phonegap Build系统构建,tel:链接仅适用于Android,不适用于ios。

我尝试过多种不同的设置无济于事(

如果有帮助,我在iOS 10.2上。但是,我相信其他版本的iOS同样会受到影响。

我很乐意帮忙!

注意,我的完整config.xml文件如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.xxx.yyy" version="5.0.6" android-versionCode="6" ios-CFBundleVersion="5.0.6.6"
        xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>XXX</name>
  <description>Description...</description>
  <author email="info@xxx.com" href="http://www.example.org/">XXX Team</author>
  <content src="index.html"/>
  <access origin="*" launch-external="yes" />
  <allow-intent href="http://*/*"/>
  <allow-intent href="https://*/*"/>
  <allow-intent href="tel:*"/>
  <allow-intent href="sms:*"/>
  <allow-intent href="mailto:*"/>
  <allow-intent href="geo:*"/>
  <platform name="android">
    <allow-intent href="market:*"/>
  </platform>
  <platform name="ios">    
    <icon src="resources/ios/icon/icon.png" width="57" height="57"/>
    <icon src="resources/ios/icon/icon@2x.png" width="114" height="114"/>
    <icon src="resources/ios/icon/icon-40.png" width="40" height="40"/>
    <icon src="resources/ios/icon/icon-40@2x.png" width="80" height="80"/>
    <icon src="resources/ios/icon/icon-40@3x.png" width="120" height="120"/>
    <icon src="resources/ios/icon/icon-50.png" width="50" height="50"/>
    <icon src="resources/ios/icon/icon-50@2x.png" width="100" height="100"/>
    <icon src="resources/ios/icon/icon-60.png" width="60" height="60"/>
    <icon src="resources/ios/icon/icon-60@2x.png" width="120" height="120"/>
    <icon src="resources/ios/icon/icon-60@3x.png" width="180" height="180"/>
    <icon src="resources/ios/icon/icon-72.png" width="72" height="72"/>
    <icon src="resources/ios/icon/icon-72@2x.png" width="144" height="144"/>
    <icon src="resources/ios/icon/icon-76.png" width="76" height="76"/>
    <icon src="resources/ios/icon/icon-76@2x.png" width="152" height="152"/>
    <icon src="resources/ios/icon/icon-83.5@2x.png" width="167" height="167"/>
    <icon src="resources/ios/icon/icon-small.png" width="29" height="29"/>
    <icon src="resources/ios/icon/icon-small@2x.png" width="58" height="58"/>
    <icon src="resources/ios/icon/icon-small@3x.png" width="87" height="87"/>
    <splash src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" height="1136"/>
    <splash src="resources/ios/splash/Default-667h.png" width="750" height="1334"/>
    <splash src="resources/ios/splash/Default-736h.png" width="1242" height="2208"/>
    <splash src="resources/ios/splash/Default-Landscape-736h.png" width="2208" height="1242"/>
    <splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
    <splash src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" height="768"/>
    <splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
    <splash src="resources/ios/splash/Default-Portrait~ipad.png" width="768" height="1024"/>
    <splash src="resources/ios/splash/Default@2x~iphone.png" width="640" height="960"/>
    <splash src="resources/ios/splash/Default~iphone.png" width="320" height="480"/>
  </platform>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="android-minSdkVersion" value="19"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="SplashScreenDelay" value="0"/>
  <preference name="FadeSplashScreen" value="false"/>
  <preference name="FadeSplashScreenDuration" value="0"/>
  <preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
  <feature name="StatusBar">
    <param name="ios-package" onload="true" value="CDVStatusBar"/>
  </feature>
  <plugin name="cordova-plugin-device" spec="~1.1.3"/>
  <plugin name="cordova-plugin-console" spec="~1.0.4"/>
  <plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
  <plugin name="cordova-plugin-splashscreen" spec="~4.0.0"/>
  <plugin name="cordova-plugin-statusbar" spec="~2.2.0"/>
  <plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
  <plugin name="cordova-plugin-google-analytics" spec="~1.5.6"/>
  <plugin name="cordova-plugin-app-version" spec="~0.1.9" />
  <icon src="resources/ios/icon/icon-small@3x.png"/>
</widget>

1 个答案:

答案 0 :(得分:0)

我通过在config.xml文件中添加以下首选项来实现此目的:

<preference name="phonegap-version" value="cli-6.4.0" />

这告诉Phonegap Build使用cli-6.4.0而不是默认值(截至2017年1月19日为cli-6.3.0)。

注意:我使用的配置文件格式对于两个版本的cli似乎都是正确的。我希望能够深入了解实际情况。

相关问题