0
votes

My Android APP is written in C#, it uses Azure Push Notification service to send push notification to Android via Firebase (FCM), iOS via Apple Push service. The push notification registration happens when the app is installed (the app also removed all previous registrations).

The push notification on iOS is working perfectly.

On Android, sometimes it receives duplicate notifications:

  • intermittent (not always)
  • on some devices only
  • happen on all scenarios when app is in foreground, background, killed
  • duplicate notifications received at the same time

and based on my DB record, i'm sure the application sends out only 1 notification. I had suspected the registration process caused the duplicate token in FCM. But later on I found out the duplication happens out of the blue, without any new uninstall/install happened on the device.

Any idea please? this has taken a lot of my time.

1

1 Answers

0
votes

This same issue I also had. To solve it, before you register with the Notification Hub, unregister the previous tags belongs to that device,

            await Task.Run(() =>
            {
                hub.Unregister();
            });

Then you register with the Notification Hub again.