Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature-request] Add <uses-permission> to manifest for each requested permission #84

Open
iakanoe opened this issue Mar 15, 2020 · 4 comments

Comments

@iakanoe
Copy link

iakanoe commented Mar 15, 2020

When trying to request some permission, if it is not declared on AndroidManifest.xml, Android will not even try to request it and directly return false when checking. I solved this temporally by adding this code on config.xml, maybe it can be added automatically.
<config-file parent="/manifest" target="AndroidManifest.xml"> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-feature android:name="android.hardware.microphone" /> </config-file>

@numerized
Copy link

Thanks you made my day!

@vladoski
Copy link

If someone has problems with android namespace, just put this in <widget> as a property so the xml is valid:

xmlns:android="http://schemas.android.com/apk/res/android"

@jampy
Copy link

jampy commented Jan 19, 2022

I agree that the plugin only asks for permissions declared with <uses-permission>, but doesn't this defeat the use of the plugin?

I'm not an Android expert, but isn't the whole point to avoid <uses-permission> for runtime permissions?

After all, also the Android guide describes <uses-permissions> as problematic:

image

Also, when publishing an app via the Play Console such permissions are listed as "required":

image

...however I need these sensitive permissions only in certain rare situations and the user should not need to grant these permissions on install.

Edit: Google Play Console also won't publish the app to devices that do not support permissions listed in <uses-permission> unless <uses-feature android:required="false" .../> is added.

Am I missing something?

@iakanoe
Copy link
Author

iakanoe commented Feb 21, 2022

@jampy As the docs say:

Beginning with Android 6.0 (API level 23), the user can approve or reject some app permisions at runtime. But no matter which Android version your app supports, you must declare all permission requests with a <uses-permission> element in the manifest. If the permission is granted, the app is able to use the protected features. If not, its attempts to access those features fail.

All runtime permissions must be declared in the manifest to be able to ask for them to be granted at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants