requestPermission(..) never returns if request has been denied by the user
See original GitHub issueI expect that a call of cordova.plugins.permissions.requestPermission
will always trigger the success callback, even if a user decides that a permission shall not be granted.
Example:
cordova.plugins.permissions.requestPermission(
cordova.plugins.permissions.CAMERA,
// I expect this callback to be called, even if the user clicks "DENY".
// Unfortunately this is not the case.
p => console.log(`Permission granted: ${p.hasPermission}`),
e => console.log("An error occured.", e)
);
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Android M - check runtime permission - how to determine if the ...
This method returns true if the app has requested this permission previously and the user denied the request. That indicates that you should ......
Read more >Method to detect if user has selected “Don't Ask Again” while ...
This method returns true if the user has previously denied the request. But if the user has selected “Dont' ask again” this method...
Read more >permission_handler | Flutter Package - Pub.dev
Rather, developers have to ask the user for permissions while the app is running. This plugin provides a cross-platform (iOS, Android) API to...
Read more >PermissionsAndroid - React Native
If a user has previously turned off a permission that you prompt for, ... the user allowed or denied the request or does...
Read more >Using the Permissions API - MDN Web Docs
For example, it can query whether permission to use a particular API is granted or denied, and specifically request permission to use an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kristopolous , I am using this plugin and when I select the “Deny” option, the app just gets closed/crashed. Am I missing anything?
cordova plugin does not fire a failure or success callback when requestPermission() is called on the very first install of the apk via USB cable or on emulator or from installing an APK build from disk. It does pop the dialog to request geo permissions fine, I grant it, but it never fires a callback. (?)
When i close the app and reopen, geolocation works, because i previously granted. But on very first install, callbacks for requestPermission() does nothing, so app is at standstill. Does anyone know what it could be? Tried on several phones, all identical behavior.
USING window.cordova.plugins: