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]: Could not invoke OneSignal.addNotificationClickListener #1734

Open
2 of 3 tasks
leminhcse opened this issue Aug 27, 2024 · 0 comments
Open
2 of 3 tasks

[Bug]: Could not invoke OneSignal.addNotificationClickListener #1734

leminhcse opened this issue Aug 27, 2024 · 0 comments

Comments

@leminhcse
Copy link

leminhcse commented Aug 27, 2024

What happened?

Sometimes, I got some crashes from firebase crashlytics:

Exception java.lang.RuntimeException: Could not invoke OneSignal.addNotificationClickListener
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:383)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:188)

Steps to reproduce?

I could not reproduce this so I'm not sure this happen when user launch app or while using app. 
Within 24 hours, there are about 50 events logged from crashlytics.

What did you expect to happen?

App can not crash

React Native OneSignal SDK version

5.0.6

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Exception java.lang.RuntimeException: Could not invoke OneSignal.addNotificationClickListener
  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
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:27)
  at android.os.Looper.loop (Looper.java:223)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:228)
  at java.lang.Thread.run (Thread.java:923)
Caused by java.lang.reflect.InvocationTargetException:
  at java.lang.reflect.Method.invoke
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
Caused by java.lang.Exception: Must call 'initWithContext' before use
  at com.onesignal.internal.OneSignalImp.getNotifications (OneSignalImp.kt:96)
  at com.onesignal.OneSignal.getNotifications (OneSignal.kt:62)
  at com.onesignal.rnonesignalandroid.RNOneSignal.addNotificationClickListener (RNOneSignal.java:344)

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

1 participant