React-native-firebase: android notifications (5.0.0-rc1): native.getNativeModule)(...).complete is not a function

Created on 11 Sep 2018  路  5Comments  路  Source: invertase/react-native-firebase

Issue

I have the following code in a react component and when I open the app from a notification I get the following error. It never reaches my handlers.

I'm using 5.0.0-rc1. Receiving and opening from notifications works fine on iOS.

    // notification listener when app is in foreground
    this.notificationListener = firebase.notifications().onNotification(payload => {
      this.props.getNotifications();
    });

    // notification listener when app is opened via remote notification
    this.notificationOpenedListener = firebase.notifications().onNotificationOpened(payload => {
      this.props.handleNotification(payload.notification);
    });
(0 , _native.getNativeModule)(...).complete is not a function
complete
    IOSNotification.js:28:4
new
    IOSNotification.js:36:4
new
    Notification.js:27:16
<unknown>
    index.js:65:48
EventEmitter.emit
    EventEmitter.js:176:32
<unknown>
    events.js:40:27
RCTDeviceEventEmitter.emit
    EventEmitter.js:190:32
MessageQueue.__callFunction
    MessageQueue.js:344:41
<unknown>
    MessageQueue.js:107:11
MessageQueue.__guard
    MessageQueue.js:291:8

Environment

  1. Application Target Platform:
    Android

  2. Development Operating System:
    macOS

  3. Build Tools:
    Android Studio

  4. React Native version:
    0.56.0

  5. React Native Firebase Version:
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'

  6. Firebase Module:
    notifications

  7. Are you using typescript?
    no

Notifications Bug Android

Most helpful comment

@aforty, I had this problem. Use "react-native-firebase": "4.3.8" instead 5.0.0-rc1, its work with RN 0.56

All 5 comments

@aforty, I had this problem. Use "react-native-firebase": "4.3.8" instead 5.0.0-rc1, its work with RN 0.56

That actually seems to be working fine, even though it shouldn't according to the docs.
Thanks @ARDcode!

Thanks for the report, I'll be addressing this in the next day or 2, it's a known issue introduced in a v5 pr, more details and duplicate here: https://github.com/invertase/react-native-firebase/issues/1445 - sorry about that.

Re rn 56 on 4.3.8, it's mostly ok, there is some edge cases where it's not; so to be safe we set 4.3.8 to be 55 only. But, if you're building and running your app fine then you'll be ok 馃憤


Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

Hey, rc2 is up, please could you try it out, this should be resolved in there now. Thanks

@aforty, I had this problem. Use "react-native-firebase": "4.3.8" instead 5.0.0-rc1, its work with RN 0.56

Same here. RN 0.56 had to revert to 4.3.8 from 5.1.1 otherwise foreground push broke with same error. What do you think @Salakar still an issue?

Was this page helpful?
0 / 5 - 0 ratings