You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I run the app inside real android device app crashes, and in my sentry I see following error (see Below)
RuntimeException
Could not invoke OneSignal.addNotificationClickListener
Exception: Must call 'initWithContext' before use
Steps to reproduce?
react native version : ^0.71.14
onesignal version: "react-native-onesignal": "^5.1.2",
I am calling Onsignal Init inside root App.tsx this way :
useEffect(() => {
Alert.alert("initialize init onesignal");
OneSignal.initialize('4ad9a4e8-a924-41f6-81fa-d8e415ef8aa9');
OneSignal.Debug.setLogLevel(LogLevel.Verbose);
.....
and later on I am doing this :
// });
Alert.alert("removing listeners");
OneSignal.Notifications.removeEventListener('click',this.notifListener)
OneSignal.InAppMessages.removeEventListener('click',this.inappListener);
// Alert.alert("adding listeners");
OneSignal.Notifications.addEventListener('click',this.notifListener );
OneSignal.InAppMessages.addEventListener('click', this.inappListener);
everything works just fine in IOS (iphone), but it fails in android pixel6 as well as pixel8
What did you expect to happen?
androdi app to start normally.
React Native OneSignal SDK version
5.1.2
Which platform(s) are affected?
iOS
Android
Relevant log output
java.lang.reflect.Method in invoke
com.facebook.react.bridge.JavaMethodWrapper in invoke at line 372
com.facebook.react.bridge.JavaModuleWrapper in invoke at line 188
com.facebook.jni.NativeRunnable in run
android.os.Handler in handleCallback at line 958
android.os.Handler in dispatchMessage at line 99
com.facebook.react.bridge.queue.MessageQueueThreadHandler in dispatchMessage at line 27
android.os.Looper in loopOnce at line 205
android.os.Looper in loop at line 294
com.facebook.react.bridge.queue.MessageQueueThreadImpl$4in run at line 228
java.lang.Thread in run at line 1012
com.onesignal.internal.OneSignalImp in getNotifications at line 96
com.onesignal.OneSignal in getNotifications at line 62
com.onesignal.rnonesignalandroid.RNOneSignal in addNotificationClickListener at line 350
java.lang.reflect.Method in invoke
com.facebook.react.bridge.JavaMethodWrapper in invoke at line 372
com.facebook.react.bridge.JavaModuleWrapper in invoke at line 188
com.facebook.jni.NativeRunnable in run
android.os.Handler in handleCallback at line 958
android.os.Handler in dispatchMessage at line 99
com.facebook.react.bridge.queue.MessageQueueThreadHandler in dispatchMessage at line 27
android.os.Looper in loopOnce at line 205
android.os.Looper in loop at line 294
com.facebook.react.bridge.queue.MessageQueueThreadImpl$4in run at line 228
java.lang.Thread in run at line 1012
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What happened?
when I run the app inside real android device app crashes, and in my sentry I see following error (see Below)
RuntimeException
Could not invoke OneSignal.addNotificationClickListener
Exception: Must call 'initWithContext' before use
Steps to reproduce?
What did you expect to happen?
androdi app to start normally.
React Native OneSignal SDK version
5.1.2
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: