react-native-firebase ejected app crashed on notification click (iOS)


#1

Hello Exponautes!

We are using react-native-firebase lib to handle our push notifications with the following snippet:

    firebase.notifications().getInitialNotification().then(notificationOpen => {
      if (notificationOpen) {
        this.onInitialNotificationReceived(notificationOpen.notification);
      }
    });

On Android it works as expected, when we click on the notification, the app starts and the listener received the notificationOpen event.

On iOS the app runs perfectly fine by itself, but when we click on a notification, its an instant crash.

Android app -> start -> OK
Android app stop -> send notification -> click on notification -> OK
iOS app -> start -> OK
iOs app stop -> send notification -> click on notification -> **KO**

We tried to set up a breakpoint on Xcode but ended up nowhere.


#2

I suspect this is due to a fatal bug in react-native-firebase https://github.com/invertase/react-native-firebase/issues/1844


#3

Hi @bacon,

We found this one too then tried one signal react native lib https://github.com/geektimecoil/react-native-onesignal on a freshly ejected Expo app and we experienced the same behavior.

Crash on start.

We are wondering if this is not because Expokit handles the notification first or something alike. Sometimes Xcode catches the exception on this area of the code.


#4

https://github.com/expo/expo/pull/3431/files This fixed it!