Adding App Permissions

I am trying to add permissions at install time (Power management, access, etc…) and have the following in config.xml

In the app the following call returns success, but never sets, or prompts user to grant permission.
I have tried this with a few other permissions such as android.permission.CAMERA, same result

cordova.plugins.Permission(“android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS”,works,broke)

Not sure if this part of the config.xml also needs setup

Usually the plugins take care of the permissions. So, if you’re using the Camera plug in, the permission will be requested automatically.

So, here are a few of the ones I am trying to set…

APP LEVEL
Unrestricted Data usage When Data Saver is ON ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS

Battery Power Savings Exclusions for my app
App Notifications ON

Device Level
Keep WIFI in when Screen is OFF

This is a PhoneGap question - you might have better results if you look there for answers on this one.

If you’re using cordova-plugin-permission, you’ll probably need a line in config.xml like this:

<plugin name="cordova-plugin-permission" source="npm"  />

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.