Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto increment iOS notification badge with Firebase Cloud Messaging?

How can I auto increment the iOS notification badge with Firebase Cloud Messaging? Is it possible to do something like +1 or ++?

like image 355
tomwassing Avatar asked Feb 12 '17 22:02

tomwassing


People also ask

Does Firebase notification work on iOS?

For Apple client apps, you can receive notification and data payloads up to 4000 bytes over the Firebase Cloud Messaging APNs interface.

Is firebase Cloud Messaging push notifications?

Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.

Does FCM work on iOS simulator?

'FCM does not work on the iOS simulator, you must test them using a real device. This is a restriction enforced by Apple.


1 Answers

You can set badge value in (notification payload). You can use your own server to send push notifications and control (increment) a badge value. There is no way to control badge number if you are sending a push notification directly from device to device with Firebase. The only way you can set a badge is when you are sure the destination device will receive only push notifications from one source device, and you can set a badge value on that source device.

like image 64
bojanb89 Avatar answered Oct 05 '22 23:10

bojanb89