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

tomwassing picture tomwassing · Feb 12, 2017 · Viewed 15.1k times · Source

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

Answer

bojanb89 picture bojanb89 · Feb 22, 2019

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.