Skip to content
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

[Bug]: RNOneSignal.requestNotificationPermission Crash #1647

Open
1 of 2 tasks
Cjaker opened this issue Feb 10, 2024 · 4 comments
Open
1 of 2 tasks

[Bug]: RNOneSignal.requestNotificationPermission Crash #1647

Cjaker opened this issue Feb 10, 2024 · 4 comments

Comments

@Cjaker
Copy link

Cjaker commented Feb 10, 2024

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
  • 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
@tandonpushkar
Copy link

tandonpushkar commented Feb 12, 2024

+1
Any solution?

@MicaelaWaigel
Copy link

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

@uasghar-smile
Copy link

+1
Any update from OneSignal officials?

@jfishman1
Copy link

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 support@onesignal.com

https://documentation.onesignal.com/docs/capturing-a-debug-log

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants