This page references our older Objective-C SDK. Check out our new Swift SDK to integrate our latest Swift-first library.
You can specify the desired badge count when you compose a push notification through the Braze dashboard. You may also update your badge count manually through your application’s
applicationIconBadgeNumber property or the remote notification payload. Braze will also clear the badge count when a Braze notification is received while the app is foregrounded.
If you do not have a plan for clearing badges as part of normal app operation or by sending pushes that clear the badge, you should clear the badge when the app becomes active by adding the following code to your app’s
applicationDidBecomeActive: delegate method:
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
UIApplication.shared.applicationIconBadgeNumber = 0
Note that setting the badge number to 0 will also clear up notifications in the notification center. So even if you don’t set badge number in push payloads, you can still set the badge number to 0 to remove the push notification(s) in the notification center after users click on the push.