Firebase Cloud Messaging (iOS) - not always setting badge !

I have now implemented Firebase Cloud Messaging (FCM) on both my iOS and Android clients - and my server backend (C#), using the Firebase Admin SDK.

I have a problem when sending push messages, sometimes the "Badge" value for iOS is ignored - I set the value on the Message() object before sending it, but for some reason every now and then it is not updated.

I keep a log of all messages sent to my client, so I can check what the value is - but sometimes its not updating the badge value.

The notification is displayed every time - and even if some of the notifications ALSO has the Badge value set - it only displays the noification, but badge is not updated.

Any idea what could be wrong ?

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    I'm not sure if it is this kind of issue but you need to set the badge parameter as a int 4 not string 4, it should be 4 not "4".

    Check

    https://stackoverflow.com/a/14256852/8187800
    https://stackoverflow.com/a/11363947/8187800

  • TonyGodtTonyGodt DKMember ✭✭

    I already do that, as I use the SDK classes to set the badge.

    But the wierd thing is that maybe every 2 out of 3 times, the badge is set/updated ...

  • ColeXColeX Member, Xamarin Team Xamurai

    Check the code logic on increasing the badge number on server backend and out print the badge number when receiving the notification on device .

    I think you have to clarify which part causes the problem .

Sign In or Register to comment.