This article explains how to clear notifications and badge counts on iOS by sending a badge count of 0, either through the Airship API or Message Composer. |
On iOS devices, the notifications for your app can be cleared from the notification center by setting your app's badge count to zero. A badge update can be sent "silently" without user alerting content or it can be included with a user alerting notification. When the badge transitions from a non-zero value to zero, the badge will be removed on the application icon and all push messages related to the app will be removed from the notification center.
This can be done through the Airship API, message composer, or from within the code of your app.
API
When sending a push notification through the Airship API a badge count is specified in the iOS override within the notification object.
{
"audience": "all",
"device_types": [
"ios"
],
"notification": {
"ios": {
"badge": 0
}
}
}
Message Composer
Under the Platform Options section, toggle the Options setting to ON for iOS and click the down arrow to reveal the iOS configuration options as shown below:
For the badge field in the iOS platform options, specifying a value of zero with your message will reset the badge to zero and clear the notifications from the notification center.
Related Content: