react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

[Bug]: RNOneSignal.requestNotificationPermission Crash

Open Cjaker opened this issue 1 year ago • 5 comments

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

Cjaker avatar Feb 10 '24 15:02 Cjaker

+1 Any solution?

tandonpushkar avatar Feb 12 '24 08:02 tandonpushkar

+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!

MicaelaWaigel avatar Feb 14 '24 11:02 MicaelaWaigel

+1 Any update from OneSignal officials?

uasghar-smile avatar Mar 06 '24 05:03 uasghar-smile

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!

jfishman1 avatar May 02 '24 19:05 jfishman1

Still have the error on RN SDK version 5.1.2

ajouve avatar Jun 22 '24 06:06 ajouve