cordova-android: grantResults empty in onRequestPermissionResult? #526
Replies: 2 comments
-
Yes, it's totally possible if the user doesn't approve or deny the permission. This can happen if the user taps literally anywhere but the modal that pops up. |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you, I didn't know this can happen and also didn't know, that this method is a Android method and not a Cordova only method. I tested it on an Android 15 emulator to dismiss the permission request dialog by typing outside the permission dialog, but I couldn't dismiss it. Tipping the back button dismissed it, but the grantResult was given. The documentation says:
So it can occur, when the permission request interaction was interrupted or I could guess, it can be dismissed by tipping somewhere else on older Android versions or on a manufacture modified OS. Thank you really much!! Regards, Manuel |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
one user reported a crash in cordova-plugin-local-noitifications PR#2058. An
ArrayIndexOutOfBoundsException
occured by accesinggrantResults
inonRequestPermissionResult
. Can it be possible, thatgrantResults
is empty?I'm talking about CordovaPlugin.java#onRequestPermissionResult:
https://github.com/apache/cordova-android/blob/a1ed1c0af7c6267f47e580e8850295202692f4ea/framework/src/org/apache/cordova/CordovaPlugin.java#L421
Regards, Manuel
Beta Was this translation helpful? Give feedback.
All reactions