-
Notifications
You must be signed in to change notification settings - Fork 191
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
Event is not sent when the android app is in the background - firebase messaging #914
Comments
Last I knew RN completely stopped execution of JS as soon as the app goes into the background in Android (not for iOS). Has this changed? Will have to retest to verify. |
We're seeing the same behaviour. Very occasionally we get some result, but it's less than 10% of the time. JS will run in the background for firebase messaging as it uses Firebase messaging uses this here and the entrypoint in the same file here We're using these packages:
|
@Rafazor do you still have this problem? I'm curious about this line:
This would be acceptable to us, but we don't see this. Are you doing some storage/queueing of the event to be sent later? EDIT: |
@mattlennon3 @oscb Thank you for your time and answers. In the meantime, I switched companies and don't have access to the codebase to confirm that the issue is still present. :) Our goal was to improve notification convergence, and we needed a way to track the number of notifications received and after that from that number of notification.received events we wanted to track how many notifications were used to open the app so the current behavior on Android ("The event is not sent when a notification is received, it's only sent later on when the app is back in the foreground.") was not super helpful because a lot of times you receive a notification but you don't actually check it. |
Thanks for the response @Rafazor. That was our thinking too, the ratio of sent:received:pressed. I reviewed some of the Segment code. There is some storage of events and a |
I'm trying to track when a notification is received. I'm using
@react-native-firebase/messaging
.Current implementation:
setBackgroundMessageHandler
is called every time a notification is received, but the track event is sent only when the app is in the foreground and not in the background. Other API calls are working as expected when they are called fromsetBackgroundMessageHandler
.Steps to reproduce
Put the app in the background and generate a notification.
Expected behavior
The event (
notification.received
) is sent to Segment.Actual behavior
The event is not sent when a notification is received, it's only sent later on when the app is back in the foreground.
The text was updated successfully, but these errors were encountered: