Open Chasty opened 9 months ago
Hi, same here !
Same reported on Sentry as a fatal crash:
react-native-onesignal
version 5.0.5
on a Samsung Galaxy S22+ (SM-S906B) on Android 14.
java.lang.NullPointerException: println needs a message
at android.util.Log.println_native(Log.java)
at android.util.Log.e(Log.java:347)
at com.onesignal.rnonesignalandroid.RNOneSignal.displayNotification(RNOneSignal.java:387)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
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:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:1012)
Relevant code has no preventDefault
explicitly called (and nothing directly related to onesignal done in receiveInAppPushNotification
), but does have some related weirdness explained in the code comment:
OneSignal.Notifications.addEventListener('foregroundWillDisplay', event => {
store.dispatch(receiveInAppPushNotification(event.notification));
/**
* Notifs not visible when app foregrounded unless we call `display()` manually here, even though no `preventDefault()`
* https://documentation.onesignal.com/docs/mobile-sdk#handle-notifications-before-displayed-when-the-app-is-in-the-foreground
* Could also call `display()` somewhere in `receiveInAppPushNotification` fn, but here seems clearer
*/
event.notification.display();
});
@Chasty and @Sondago have you found a fix? E.g. is the latest minor version of OneSignal without this error?
Are you guys gonna fix this PRINT problem or what
What happened?
Crashlytics are reporting this issue.
RNOneSignal.preventDefault
com.onesignal.rnonesignalandroid RNOneSignal.java:392
Steps to reproduce?
What did you expect to happen?
-
React Native OneSignal SDK version
5.0.0
Which platform(s) are affected?
Relevant log output
Code of Conduct