-
-
Notifications
You must be signed in to change notification settings - Fork 50
[Android >= 33] firebase request permessions causing app crash #144
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
Comments
this line causing the crash more specifically this But even though the permission was not granted! |
Strange think that the docs say's that |
Seems like an error on my part 😫 |
Oh sorry wait .. I am confusing, you are right .. it is array but in the parameters table it is marked as int public void onRequestPermissionsResult (int requestCode,
[String[]](https://developer.android.com/reference/java/lang/String) permissions,
int[] grantResults)
Parameters
--
requestCode | int: The request code passed in requestPermissions(java.lang.String[], int).
permissions | String: The requested permissions. Never null.
grantResults | int: The grant results for the corresponding permissions which is either PackageManager.PERMISSION_GRANTED or PackageManager.PERMISSION_DENIED. Never null.
Parameters
requestCode int: The request code passed in [requestPermissions(java.lang.String[], int)](https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)).
permissions String: The requested permissions. Never null.
grantResults int: The grant results for the corresponding permissions which is either [PackageManager.PERMISSION_GRANTED](https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED) or [PackageManager.PERMISSION_DENIED](https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED). Never null. |
The final result that is an empty array .. for that the app crash with to prevent the crash we should add this but the permission not granted! because the plugin doesn't popup the UI until you exit the app or finishing the app and restarting again !! (please not: if I modify the app and restart it from livesync it doesn't open the permission dialog) the app should be finished or killed the docs tel:
if (event.requestCode === 1001) {
if(event.grantResults.length > 0) {
if (event.grantResults[0] === android.content.pm.PackageManager.PERMISSION_GRANTED) {
resolve(0);
}
else {
reject(1);
}
}
else {
reject(1);
}
} |
Hi @triniwiz :)
Firebase crash the app on requesting permissions, It working fine before upgrading to NS 8.3.5!
The text was updated successfully, but these errors were encountered: