How to set permissions for Android using Phonegap Build?

江枫思渺然 提交于 2019-12-13 16:44:33

问题


I tried other solutions around here but no matter what I do the same permissions are asked during install of my app. I tried removing a bunch of the "plugins" phonegap uses, namely: (from the config.xml)

  <gap:plugin name="org.apache.cordova.battery-status"/>
  <gap:plugin name="org.apache.cordova.camera"/>
  <gap:plugin name="org.apache.cordova.media-capture"/>
  <gap:plugin name="org.apache.cordova.contacts"/>
  <gap:plugin name="org.apache.cordova.geolocation"/>
  <gap:plugin name="org.apache.cordova.globalization"/>

Yet when I update my code and then try to install the apps it still asks for stuff like location.

Anyone who knows this?


回答1:


It isn't the plugins that declare the permissions. The permissions are declared with feature elements like

<feature name="http://api.phonegap.com/1.0/camera"/>
<feature name="http://api.phonegap.com/1.0/device"/>
<feature name="http://api.phonegap.com/1.0/file"/>
<feature name="http://api.phonegap.com/1.0/network"/>


来源:https://stackoverflow.com/questions/27876730/how-to-set-permissions-for-android-using-phonegap-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!