Badges
You can specify the desired badge count when you compose a push notification through Braze’s 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:
1
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
1
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.