wix / react-native-notifications

React Native Notifications
MIT License
3.25k stars 765 forks source link

Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module. #888

Closed moonbe77 closed 2 years ago

moonbe77 commented 2 years ago

How to reproduce. Open the app while receiving a notification. How I get this crash is to send a notification and open the app just before the notification is received.

Am I missing something is there something I can do to avoid this crash.

"react-native-notifications": "^4.3.1" "react-native": "0.67.4"

image Fatal Exception: java.lang.IllegalStateException Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module. com.facebook.react.bridge.ReactContext.getJSModule (ReactContext.java:159) com.wix.reactnativenotifications.core.JsIOHelper.sendEventToJS (JsIOHelper.java:21) com.wix.reactnativenotifications.core.JsIOHelper.sendEventToJS (JsIOHelper.java:13) com.wix.reactnativenotifications.core.notification.PushNotification.notifyReceivedBackgroundToJS (PushNotification.java:205) com.wix.reactnativenotifications.core.notification.PushNotification.onReceived (PushNotification.java:67) com.wix.reactnativenotifications.fcm.FcmInstanceIdListenerService.onMessageReceived (FcmInstanceIdListenerService.java:28)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 2 years ago

The issue has been closed for inactivity.