【问题标题】:Cordova Plugin Whitelist with Phonegap Build doesn't work on iOS带有 Phonegap Build 的 Cordova 插件白名单在 iOS 上不起作用
【发布时间】:2017-01-19 23:05:40
【问题描述】:

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

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

我的应用中有如下代码:

window.open('tel:2065551212');

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

如果我使用 Adob​​e 的 Phonegap Build 系统构建,电话:链接仅适用于 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>

【问题讨论】:

    标签: cordova-plugins phonegap-build


    【解决方案1】:

    我通过在我的 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 似乎都是正确的。我很想深入了解实际发生的情况。

    【讨论】:

      猜你喜欢
      • 2017-06-22
      • 2015-06-30
      • 1970-01-01
      • 1970-01-01
      • 2016-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多