react-native-onesignal
react-native-onesignal copied to clipboard
[Bug]: RNOneSignal.requestNotificationPermission Crash
What happened?
Hello,
On our project we are using OneSignal 5.0.2 and we are having many users (69% of users on Android 6 and 30% of users on Android 5, based on 2.3k~ users) are having crash on the function of title.
If needed I can try bringing more information, I'm available to help.
Steps to reproduce?
Unfortunately, we don't have steps to reproduce yet, we are working on it.
What did you expect to happen?
Should request permissions without causing an exception.
React Native OneSignal SDK version
Release 5.0.2
Which platform(s) are affected?
- [ ] iOS
- [X] Android
Relevant log output
`java.lang.NoClassDefFoundError - com.onesignal.rnonesignalandroid.RNOneSignal$$ExternalSyntheticLambda0`
Fatal Exception: java.lang.RuntimeException: Could not invoke OneSignal.requestNotificationPermission
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:238)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:818)
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
+1 Any solution?
+1 Any solution?
Hi! We were having a similar problem, and our solution was to migrate the permissions request to react-native-permissions and initialize OneSignal once the user acepts them. So far we have no problems in this way.
I hope it helps!
+1 Any update from OneSignal officials?
Looks like we fixed this in RN SDK version 5.0.3 https://github.com/OneSignal/react-native-onesignal/releases/tag/5.0.3
Please upgrade and if you still have issues, you can follow this guide to get a log and share it here or with [email protected]
https://documentation.onesignal.com/docs/capturing-a-debug-log
Thanks!
Still have the error on RN SDK version 5.1.2