-
Notifications
You must be signed in to change notification settings - Fork 459
App crash after permissions dialog closed #288
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
I confirm that @ThinhVu's proposed solution fixes the problem ! |
I can also confirm @ThinhVu answer worked! Don't forget to also I created a diff patch for now to ensure this fix stays in place on my local build until it can be addressed, feel free to use the following as
|
Thanks @nerdymind-dev |
Also currently using the PR successfully. Please merge :) |
Bug report
Note that the bug occur in some of my apps (and another apps still running without any problem).
Description
App crash after permissions dialog closed
Steps to Reproduce
Install and run app on the first time
Versions
Logs
Root cause:
In RNCallKeep module, we have a method to check and request permissions like so:
The
requestPermissions
method above is a static method ofandroidx.core.app.ActivityCompat
class.Base on my investigation, react-native already included a module named
PermissionsModule
which will be used to request permissions for android devices.You can read source code of this class at
https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java
When permission dialog closed, onResume event life cycle will be executed. After that, PermissionsModule::onRequestPermissionsResult will be execute (for some reason -- i don't have enough time to research it).
In this method, getting mCallback of request code 1337 (aka REQUEST_READ_PHONE_STATE) return null.
And invoke it thrown a Fatal exception.
Fix
Replace
with
The text was updated successfully, but these errors were encountered: