How to add permissions to Android PhoneGap project?

后端 未结 1 1641
猫巷女王i
猫巷女王i 2021-01-16 16:45

A plugin I am using to access the AccountManager in android through phonegap requires some permissions. I am using PhoneGap 3.4.0. In the config.xml in my www folder there i

相关标签:
1条回答
  • 2021-01-16 17:42

    Please check you have declared the following.

     <feature name="NetworkStatus">
             <param name="android-package" value="CDVConnection" />
     </feature>
    

    Network status will be the feature name and value will be your class name.

    In Android Manifest,

     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    

    Aso check cordova_plugin.js

    cordova.define('cordova/plugin_list', function(require, exports, module) {
        module.exports = [{
            "file": "plugins/org.apache.cordova.dialogs/www/notification.js",
            "id": "org.apache.cordova.dialogs.notification",
            "merges": ["navigator.notification"]
        }, {
            "file": "plugins/org.apache.cordova.network-information/www/network.js",
            "id": "org.apache.cordova.network-information.network",
            "clobbers": ["navigator.connection", "navigator.network.connection"]
        }];
        module.exports.metadata = // TOP OF METADATA 
        {
            "org.apache.cordova.device": "0.2.8",
            "org.apache.cordova.network-information": "0.2.7"
        }
    });
    

    These are some permission types.

    Thanks.

    0 讨论(0)
提交回复
热议问题