Get all permissions during app installation on targeting API 26

Viewed 4091

In Android API version 22 and before, system will get all permission while installation. From API 23(Marshmallow), system asks for permission during runtime(when the app actually tries to use a feature). This is not working out very well for some of the reasons.

  • Developer has to write 2 different(1 - if user grants permission, 2. if user denied the permission) flows of code all the time.

  • While requesting permission, Android has the full control to show what is the text to be displayed on the permission dialog and asks user to press Yes or No. Sometimes, the text displayed on the permission dialog is inappropriate.

  • When we request more than one permission and if one of the permission is denied, app crashes due to Android code bug. This is an issue with API 23, 24 and 25. I think its fixed in 26.

Issues faced in our app,

Example 1 : For security reasons, we are trying to get device id but when we request permission, Android shows message like 'Allow MyApp to manage phone calls'. We have nothing to do with phone calls, the message is inappropriate to access device id. This drops user registrations(sign-up) on the app and marketing team is highly worried.

Example 2: We have lot of web views and we try to use the offline storage and cache as much as possible for better user experience, but users are denying the permission because, Android permission dialog shows 'Allow MyApp to access storage files'.

So, the question is, Is there anyway to get all the permissions during app installation itself(like API v22 and before) on the newer API versions(23 and above) rather than requesting during run-time?

2 Answers
Related