React-native-firebase: messaging.onMessage callback fires when re-opening an app on Android

Created on 21 Feb 2018  路  2Comments  路  Source: invertase/react-native-firebase

Issue

The messaging.onMessage callback fires when re-opening an app on Android.

For example with this code, open an app, then background the app (don't close it):

// This gets called once on app mount.
firebaseApp.messaging().onMessage(notification => {
  // onMessage handler stuff, gets fired whenever the app is backgrounded and then re-opened.
});

Bring the app back up, and the callback for "onMessage" is fired.

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 6.10.3
Yarn: 1.3.2
npm: 3.10.10
Watchman: Not Found
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.52.2 => 0.52.2
react-native-firebase: 3.2.5 => 3.2.5

Most helpful comment

@dannycochran Thanks for raising - this will be addressed as part of the work on #595 which is now well underway

All 2 comments

@dannycochran Thanks for raising - this will be addressed as part of the work on #595 which is now well underway

Good news, the long awaited alpha of our messaging and notifications overhaul is now available!!

Check out the release notes here: https://github.com/invertase/react-native-firebase/releases/tag/v4.0.0-alpha.1

If you have any comments and suggestions or want to report an issue, come find us on Discord

Was this page helpful?
0 / 5 - 0 ratings