Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] Notification object is missing from remoteMessage when getInitialNotification triggered #4943

Closed
1 of 5 tasks
alison-unmind opened this issue Feb 24, 2021 · 3 comments
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@alison-unmind
Copy link

alison-unmind commented Feb 24, 2021

Issue

Upgrading to 7.8.10 to make use of the bug fix for issue 4052. We find that under the specific scenario described in that issue, the notification part of our message does not get included in the remoteMessage.

Steps to replicate:

  1. Send two push notifications with the following message payload:
{ 
  notification: {
    title: "Test title",
    body: "Test body",
  },
  data: {
    label: "Test label",
  }
}
  1. Open one of them, then quit the app
  2. Open the second one

Expected behaviour: For both notifications, when they are opened getInitialNotification gets called with a remoteMessage containing both data and notification
Actual behaviour: For the first notification opened, as expected getInitialNotification gets called with a remoteMessage containing both data and notification. For the second however, the remoteMessage only contains the data portion of the original message

  • Platform that you're experiencing the issue on:

    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:

    • 7.8.10, also replicated in 10.8.0
  • Are you using TypeScript?

    • Y, VERSION 4.1.3
@alison-unmind alison-unmind added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Feb 24, 2021
@mikehardy
Copy link
Collaborator

Hi there!
We have seen this on android emulators, please confirm you are using a real device
You have ignored most of the template, please open a new issue and do not ignore the template

@alison-unmind
Copy link
Author

Sorry, do you mean you have seen this working as expected (sending the notification as well as data through), on emulators?

I am seeing this issue occurring on both a physical device and on an emulator.

I'll have another go writing this up with more of the template 👍

@mikehardy
Copy link
Collaborator

Sorry, do you mean you have seen this working as expected (sending the notification as well as data through), on emulators?

I never test messaging-related things with the expectation they will work, on emulators. Even though Android does deliver FCM to emulators (iOS does not even do that - simulators do not get a token, and do not receive FCM) there have been errors in the past so FCM testing for me is "device-only"

I am seeing this issue occurring on both a physical device and on an emulator.

If it is reproducible on a device, then this could be a valid issue!

I'll have another go writing this up with more of the template +1

Thank you - the template contains all sorts of things that we look for and can cause subtle errors, it really is important. Even better is the full JSON payload you send via the FCM REST API (minus any identifiers of course) plus an App.js that by itself - dropped in to a clean project like from https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh - reproduces the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

No branches or pull requests

2 participants