这是关于config.xml配置的一般问题。我在版本之间有点混淆,哪些文档是正确/旧的。
为webapp使用phonegap构建。带有重定向的简单index.html。 我已经阅读了文档,并尝试了各种配置:
<plugin...
<gap:plugin..
以及
插件中的各种名称类型name="org.apache.cordova..."
name="cordova.plugin..."
但每当我安装应用时,权限都不会出现在列表中。我使用phonegap build 3.XX时曾经请求过的权限。这是我的config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.whatever.testing123"
versionCode = "5"
version = "1.0.4" >
<name>Hey is this thing on?</name>
<description>
Checking for permissions
</description>
<author href="https://www.testing123.com" email="support@testing123.com">
Testing123
</author>
<gap:platform name="ios" />
<gap:platform name="android" />
<gap:platform name="winphone" />
<preference name="orientation" value="portrait" />
<preference name="phonegap-version" value="cli-5.2.0" />
<preference name="fullscreen" value="true" />
<preference name="loadUrlTimeoutValue" value="700000" />
<preference name="LoadingDialog" value="Please wait, the app is loading"/>
<preference name="AllowInlineMediaPlayback" value="true"/>
<preference name="SplashScreenDelay" value="7000"/>
<preference name="KeepRunning" value="true"/>
<icon src="res/icon/android-icon-36x36.png" gap:platform="android" gap:qualifier="ldpi" />
<icon src="res/icon/android-icon-48x48.png" gap:platform="android" gap:qualifier="mdpi" />
<icon src="res/icon/android-icon-72x72.png" gap:platform="android" gap:qualifier="hdpi" />
<icon src="res/icon/android-icon-96x96.png" gap:platform="android" gap:qualifier="xhdpi" />
<icon src="res/icon/apple-icon-57x57.png" gap:platform="ios" width="57" height="57" />
<icon src="res/icon/apple-icon-72x72.png" gap:platform="ios" width="72" height="72" />
<icon src="res/icon/apple-icon-76x76.png" gap:platform="ios" width="76" height="76" />
<icon src="res/icon/apple-icon-114x114.png" gap:platform="ios" width="114" height="114" />
<icon src="res/icon/apple-icon-144x144.png" gap:platform="ios" width="144" height="144" />
<icon src="res/icon/apple-icon-120x120.png" gap:platform="ios" width="120" height="120" />
<icon src="res/icon/apple-icon-152x152.png" gap:platform="ios" width="152" height="152" />
<icon src="res/icon/android-icon-72x72.png" gap:platform="webos" />
<icon src="res/icon/android-icon-48x48.png" gap:platform="winphone" />
<icon src="res/icon/apple-icon-180x180.png" gap:platform="winphone" gap:role="background" />
<gap:splash src="res/screen/default.png" />
<gap:splash src="res/screen/default.png" gap:platform="android" gap:qualifier="port-ldpi" />
<gap:splash src="res/screen/mdpi.png" gap:platform="android" gap:qualifier="port-mdpi" />
<gap:splash src="res/screen/hdpi.png" gap:platform="android" gap:qualifier="port-hdpi" />
<gap:splash src="res/screen/xhdpi.png" gap:platform="android" gap:qualifier="port-xhdpi" />
<gap:splash src="res/screen/xxhdpi.png" gap:platform="android" gap:qualifier="port-xxhdpi" />
<gap:splash src="res/screen/xxxhdpi.png" gap:platform="android" gap:qualifier="port-xxxhdpi" />
<gap:splash src="res/screen/default.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="res/screen/640x960.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="res/screen/640x1136.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="res/screen/750x1334.png" gap:platform="ios" width="750" height="1334" />
<gap:splash src="res/screen/768x1024.png" gap:platform="ios" width="768" height="1024" />
<gap:splash src="res/screen/1242x2208.png" gap:platform="ios" width="1242" height="2208" />
<gap:splash src="res/screen/default.png" gap:platform="winphone" />
<gap:plugin name="cordova-plugin-camera" spec="0.3.6" source="npm" />
<gap:plugin name="cordova-plugin-media-capture" spec="1.0.1" source="npm" />
<gap:plugin name="cordova-plugin-device" source="npm" />
<gap:plugin name="cordova-plugin-device-orientation" source="npm" />
<gap:plugin name="cordova-plugin-device-motion" source="npm" />
<gap:plugin name="cordova-plugin-file" source="npm" />
<gap:plugin name="cordova-plugin-file" source="npm" />
<gap:plugin name="cordova-plugin-file-transfer" source="npm" />
<gap:plugin name="cordova-plugin-media" spec="0.2.16" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
<gap:plugin name="cordova-plugin-globalization" source="npm"/>
<gap:plugin name="cordova-plugin-dialogs" source="npm" />
<gap:plugin name="org.apache.cordova.splashscreen" source="npm" />
<gap:plugin name="cordova-plugin-vibration" spec="1.2.0" source="npm" />
<gap:plugin name="com.indigoway.cordova.whitelist.whitelistplugin" spec="1.1.1" source="pgb" />
<gap:plugin name="com.sharinglabs.cordova.plugin.cache" spec="1.0.0" source="pgb" />
<gap:plugin name="org.apache.cordova.statusbar" spec="0.1.4" source="pgb" />
<access origin="*" browserOnly="true" />
<allow-navigation href="*" />
<allow-intent href="*" />
</widget>
所以,最大的问题是我的插件是否正确配置了cli-5.2.0,插件是否应该在应用安装期间请求权限?
答案 0 :(得分:0)
实际上,没关系。我把它整理好了cli-5.2.0。无论如何,我最终都使用了这些插件。这是xml的部分
<gap:plugin name="cordova-plugin-camera" spec="0.3.6" source="npm" />
<gap:plugin name="cordova-plugin-file" source="npm" version="3.0.0"/>
<gap:plugin name="cordova-plugin-file-transfer" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
<gap:plugin name="cordova-plugin-dialogs" source="npm" />
<gap:plugin name="cordova-plugin-splashscreen" source="npm" />
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
<gap:plugin name="ionic-plugin-keyboard" source="npm" />
<gap:plugin name="cordova-plugin-geolocation" source="npm" />