4

Today, I received duplicate FCM push notifications over a period of ~30 mins. These push notifications are identical in terms of content, and the push notification was sent ONCE. Here's a snippet of the timeline of when I was receiving these push notifications:

1   01-15 10:41:30.349+0200 MyPushListenerService   onMessageReceived
1   01-15 10:43:30.004+0200 MyPushListenerService   onMessageReceived
1   01-15 10:47:31.665+0200 MyPushListenerService   onMessageReceived
1   01-15 10:55:32.062+0200 MyPushListenerService   onMessageReceived

Why does this happen?

How does Firebase confirm that a push notification was delivered? Are there retry mechanism?

KENdi
  • 7,576
  • 2
  • 16
  • 31
kyrax
  • 1,192
  • 3
  • 13
  • 29
  • could it be you registered 2 tokens at the same service? this happened to me when installing 2 flavours of the same app on 1 device – thepoosh Jan 16 '18 at 12:30
  • @thepoosh would that explain that I am still getting the same push notifications 30 mins later? Also, I only have 1 flavor of the app installed. – kyrax Jan 17 '18 at 08:49
  • Did you resolve it? I have the same issue. – tuledev May 07 '19 at 08:21

1 Answers1

0

First you should check what is triggering the FCM to send a message. If it is triggered by a Firebase Google Cloud Function, then you can use the Firebase Console to see the logs in your index.js file.

Also, you can check to see if Firebase sent the message by getting a "Response" and logging it in the Firebase Console.

For example, in Cloud Functions:

return admin.messaging().sendToDevice(token_id, payload).then(response => {
    console.log('notification sent successfully: ' + response);
    }).catch((error) => {
         console.log('notification sent error ' + error);
    });
});

Then look in your Firebase Console, Functions Logs - and see what the output was.

Jeff Padgett
  • 2,380
  • 22
  • 34