We are using Firebase cloud messaging. Sometimes when Android or iOS app is in sleep mode the cell phone receives same (duplicates) notifications messages. For device identifications the FIRInstanceID token is used. An external server on node.js is used for sending notifications to Firebase service. No duplications in our server log file are presented.
Asked
Active
Viewed 1.1k times
8
-
Firebase has a lot of issues, but not this. Check your server again for this. Problem must be on your side. – Hisham Muneer Aug 18 '16 at 11:33
-
10Firebase has a lot of issues AND also this. I can confirm this behavior on several devices Android 4.4 and 5.0. I am only using Firebase console for sending push notifications. – Catalin Morosan Aug 18 '16 at 14:52
-
Do you happen to have a sample payload being sent by the server? Even one that has redacted values may provide a clue as to the answer. – PGMacDesign Jul 24 '17 at 18:49
3 Answers
0
check this answer, That worked for me... https://stackoverflow.com/a/44435980/1533285
I was requesting permissions to GCM too so Systray showed two notifications.
jlbofh
- 399
- 5
- 7
0
in file firebase-messaging-sw.js
comment this line
// self.registration.showNotification(notificationTitle,notificationOptions)
and no duplicate fcm anymore
bemygon
- 43
- 6
0
I had the same problem today with my app, after several hours of debuging it seems that the problem is the payload am sending:
{
"registration_ids":["token", "token2",...],
"data":{
"title":"notification title",
"body":"notification body",
"screen":"product",
"id":1
},
"android":{
"ttl":"1000s",
"priority":"high",
"notification":null //<= set notification to null
}
}
After setting notification to null , no dupicate notifications.
baadr qaaba
- 23
- 1
- 5