-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
I receive only last one message when turn on internet? #1007
Comments
@pahnpiseth this isn't enough information to tell what's going on here. Can you show more about how you're sending these messages? Is the behavior thee same if the device stays online the whole time? |
i'm edited hope it enough info...please help. |
@pahnpiseth you mention
Your example payload has a notification object defined. So is the problem happening with or without the notification payload? |
@pahnpiseth Note that Does this resolve your issue? |
okay,brother mean when send message fcm with "notification" payload cannot use with non-collapse key? |
FCM document not mention this. |
I have checked with and without collapse key but only last message come when turn on internet. Please tell me how to fix this issue or give some suggestion to fix it. |
|
|
Hello, is there any solution to this issue? I have also been trying to this i tested this with the tool from the FCM while it is successfully receives all notification when it is online, once the device turns offline. Sending multiple FCM notifications and once the network have return. Only the last FCM notification will be receive. hoping to get some solutions |
😭😭😭😭m nnnn |
Has anyone solved this issue yet? |
Same problem |
i'm having the same issue |
The issue is still present unfortunately and I've had tested it in all possible scenarios. I've read the Firebase documentation carefully to attempt and figure out a solution. nothing seems to fix this yet. I've been using the Firebase legacy API and I've upgraded to Firebase Cloud Messaging API (V1) to verify whether or not the issue was caused by the legacy API, I can confirm it happens on both. Steps to produce if anyone is still uncertain about how it happens: You will notice that only the last message out of the five messages will be delivered. I've played around with the priorities just in case but no luck it keeps on happening. |
Hello everyone, I'm trying to clarify this problem which in reality is not a problem but depends on how Android and Firebase decide to manage notifications. There are two types of notifications:
As per Google documentation, notifications that have the notification key are considered "always collapsible" https://firebase.google.com/docs/cloud-messaging/concept-options This means that when the notifications are sent, a collapse_key with this value com.organization.myapp is automatically added in the json of the notification Even if you try to change this value by changing the "collapse_key" key to a random value that always change, the Firebase SDK will overwrite that value again with "com.organization.myapp" on sending the notification. In this way, exactly the behavior we complain about is manifested: if we put the smartphone in airplane mode and send 5 notifications, we will only receive the last one. This is because the collapse_key is always the same and therefore FCM will overwrite the notifications with the same key keeping only the last one and delivering only that one to the user. If, on the other hand, we send a notification without the notification key and only with the data key, this will have no "collapse_key" and in this way all notifications will be delivered without any problems. Obviously notifications without the notification key are not delivered to the user like those that do contain it and therefore a personal way must be created to make the notification pop-up appear on the user's smartphone |
i've tried to implement data notifications only, the results are the same |
impossible, i was stuck on that problem and i've solved it. you specifiy "collapse_key" in your json? can you post your notification json or configuration? |
|
You are using "notification" key inside "android" key. is the same of use "notification" in root of message configuration. |
without notification key notifications doesn't appear |
And this is what i've write. if you want non collapsible notification you need to use external library to show notification pop-up, for example notifee, or write you're own way to show notification pop-up when you receive notification. |
Data messages works good. Thanks! |
Please do leave code guys, If anyone solved the problem...I'm stuck |
hope it will help |
Thanks @untrueme I'll use notifee to handle the notification |
this soluation is worked for me |
I've tested the solution suggested by @zell180 , it only works when the app is opened (open the app, turn off wifi, send notifications, turn on wifi). Anyone has some updates on this? |
Can you paste notification that you’re try to send? Android or iOS? |
I'm using and testing on Android only await messaging.send({
token: 'abc123',
data: {
title: 'the title',
body: 'the body',
},
android: {
priority: "high",
ttl: '2419200s'
}
}) This as I said works when the app is open, but get ignored when it's not |
After receiving last notification when turned on internet why don't you use socket to grap the notifications saved on server and show it as locally, because their is no solution for this issue till now. |
I'm not saving the notifications on the server unfortunately. but I might refactor to use your suggestion. Is this a Firebase issue, if so, is there any alternative that provides this functionality? |
As far I did my research unfortunately found nothing... Rather than implementing in above way |
Hi Did you find any solution for the above issue? |
It is working now for Android. How to do same with APNs? |
send with notification payload for background notification.
but if send without "notification" payload i receive notification is normal when send while device off internet and then device turn on internet.
https://fcm.googleapis.com/fcm/send
Step 1: Describe your environment
Step 2: Describe the problem:
Steps to reproduce:
Note**: but when send notification while device online notification receive normal
Observed Results:
2019-12-03 14:03:47.765 4931-4931/? V/FA-SVC: NetworkBroadcastReceiver received action: android.net.conn.CONNECTIVITY_CHANGE
2019-12-03 14:03:47.801 4931-15302/? V/FA-SVC: Unregistering connectivity change receiver
2019-12-03 14:03:47.802 4931-15302/? V/FA-SVC: Upload scheduled in approximately ms: 3047916
2019-12-03 14:03:47.802 4931-15302/? V/FA-SVC: Cancelling job. JobID: 812057698
2019-12-03 14:03:47.811 4931-15302/? V/FA-SVC: Scheduling upload with GcmTaskService
2019-12-03 14:03:47.811 4931-15302/? V/FA-SVC: Scheduling task with Gcm. time: 3047916
2019-12-03 14:03:48.216 10173-15301/com.tss.testfcmraw D/FA: Logging event (FE): notification_receive(_nr), Bundle[{ga_event_origin(_o)=fcm, message_type(_nmc)=display}]
2019-12-03 14:03:48.309 10173-15301/com.tss.testfcmraw V/FA: Connecting to remote service
2019-12-03 14:03:48.330 10173-15301/com.tss.testfcmraw D/FA: Connected to remote service
2019-12-03 14:03:48.333 10173-15301/com.tss.testfcmraw V/FA: Processing queued up service tasks: 1
2019-12-03 14:03:48.367 4931-15302/? V/FA-SVC: Logging event: origin=fcm,name=notification_receive(_nr),params=Bundle[{ga_event_origin(_o)=fcm, message_type(_nmc)=display}]
2019-12-03 14:03:48.395 4931-15302/? V/FA-SVC: Saving event, name, data size: notification_receive(_nr), 35
2019-12-03 14:03:48.396 4931-15302/? V/FA-SVC: Event recorded: Event{appId='com.tss.testfcmraw', name='notification_receive(_nr)', params=Bundle[{ga_event_origin(_o)=fcm, message_type(_nmc)=display}]}
2019-12-03 14:03:48.398 4931-15302/? V/FA-SVC: Upload scheduled in approximately ms: 3047320
2019-12-03 14:03:48.399 4931-15302/? V/FA-SVC: Cancelling job. JobID: 812057698
2019-12-03 14:03:48.402 4931-15302/? V/FA-SVC: Scheduling upload with GcmTaskService
2019-12-03 14:03:48.402 4931-15302/? V/FA-SVC: Scheduling task with Gcm. time: 3047320
2019-12-03 14:03:48.407 4931-15302/? V/FA-SVC: Background event processing time, ms: 41
2019-12-03 14:03:53.373 10173-15301/com.tss.testfcmraw V/FA: Inactivity, disconnecting from the service
Expected Results:
When turn on internet i want to get 10 notification.
Relevant Code:
The text was updated successfully, but these errors were encountered: