is it possible to set the application badge, while the app is in background mode or even closed? I haven't found anything, yet.
From within your application you can use the applicationIconBadgeNumber
property of UIApplication
to set the badge number:
[UIApplication sharedApplication].applicationIconBadgeNumber = 1;
If you want to change the badge without the user launching your app, you need to use the push notification service. The Push Notification Service Programming Guide should have all the info you need.
It is possible via push notifications (as you've tagged) but bare in mind that if the user has disallowed push notifications it won't work.
To update the badge number via push, you need to include the following in your payload:
"badge" : 23
For more info about the payload, see this apple doc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With