Set permissions for app at runtime

Asked

Viewed 885 times

0

There are some app’s that when we will open for the first time it asks the user for permission to activate certain device features such as camera, contacts calendar, etc...

How to make the permission request at the moment it is opened instead of the moment the installation is made?

  • When you make use of camera for example, once you run such a function, it will ask for permission.

  • This does not happen. Only at the time of installation and not at the time of execution. I’m testing on a motog5, this would have some influence on android version, settings etc?

  • Yes, there is. If you quote what permissions you are trying to access, it is easier to help you

  • The permissions the app should ask the user when it opens are: Identity, Contacts, Location, SMS, Phone, Photos/media/files, Camera, Wifi connection information, Device ID/Call information, Device IMEI

  • Focus is on the device asking for permissions the moment it is opened by the user.

2 answers

0

0

For versions of Android 6 or higher it is mandatory that dangerous permissions are requested at runtime, so it is important to know this.

Permissions such as internet access and Wi-Fi configuration are not considered dangerous, but camera access, data etc are considered. Android does not allow the app to have access to functionality with the old permission type, IE, ask the installation does not work on Android equal or higher than version 6.

  • This solution is using Cordova for hybrid applications or just for Android?

  • I do not know if exactly this solution will help you, because I only program in java on android, but I know for sure you will have to ask permission at runtime versions equal or higher than 6

Browser other questions tagged

You are not signed in. Login or sign up in order to post.