Dialog not showing
See original GitHub issueHi,
the dialog isn’t showing for me. The api of my app is 14 and the device which I’m trying on is on Android 6.0 version. I’m trying to get CAMERA permission for example. I have modified the plugin by adding another permission:
private String[] getPermissions(JSONArray permissions) { String[] stringArray = new String[permissions.length() + 1]; for (int i = 0; i < permissions.length(); i++) { try { stringArray[i] = permissions.getString(i); } catch (JSONException ignored) { //Believe exception only occurs when adding duplicate keys, so just ignore it } } stringArray[1] = Manifest.permission.READ_EXTERNAL_STORAGE; return stringArray; }
and this works: I can see both permission dialogs showing up.
If I hardcode this permission it does the job as well:
private String[] getPermissions(JSONArray permissions) { String[] stringArray = new String[permissions.length()]; for (int i = 0; i < permissions.length(); i++) { try { stringArray[i] = Manifest.permission.READ_EXTERNAL_STORAGE; } catch (JSONException ignored) { //Believe exception only occurs when adding duplicate keys, so just ignore it } } return stringArray; }
Hardcoding the Manifest.permission.CAMERA
wouldn’t work.In that scenario though.
Any ideas? I’m still confused why it wouldn’t work on some scenarios and it would on others. Without tweaking the plugin I couldn’t get it to work on any permission I requested.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (2 by maintainers)
Had the same problem. Forgot to add video permission to Android Manifest after
platfrom remove, platform add
. Everyone having the same issue, double-check your AndroidManifest.xml, it should contain either one or both of theseHad the same problem. Ended by adding this in my config.xml (cordova 9+) :