[SalesForce] Reset the notification badge on iOS

Asking for a friend…

When using Marketing Cloud to send push notifications, the red badge counter is often only increasing instead of being reset.

We tried using the specific method resetBadgeCount, but no luck.

Is there something specific that needs to be done either on the cloud or in the app to make sure the counter is reset as soon as the app is open?

Some clarifications from my shy developer colleague:

Each time the application has the badge number greater than 0, it calls the JB4ASDK method to reset it.

According to documentation it looks like this: [[ETPush pushManager] resetBadgeCount];

The Marketing Cloud server continues increasing the badge number although the application refreshes badge counter to 0.

The badge number counter on server was checked after 10 and 60 minutes.

Steps to reproduce:

  1. Send manual push notification to the device with specific system token.
  2. Check if the mobile app has badge number '1' after the receiving of push notification.
  3. Open the application. On this step the app calls [[ETPush pushManager] resetBadgeCount]
  4. Minimize the app and check if the badge number disappeared, i.e. the badge number was reset locally.
  5. Wait some time 10-60 minutes for server synchronization.
  6. Send another manual push notification to the same device.
  7. Check the application badge number.

Actual result:
The badge number shows '1' after 1st message and '2' after the 2nd message.

Expected result:
The badge number shows '1' after 1st message and also '1' after the 2nd message.

Best Answer

To quote the current documentation (ETPush.h)

/** Reset the application's badge number to zero (aka, remove it). Call updateET to refresh the server with the current badge number. Note: updateET may not be fully processed by the server for a number of minutes; the server's badge value may be out of sync with the app for a short amount of time.

*/

-(void)resetBadgeCount;

You'd want to follow a call to resetBadgeCount with a call to updateET which will ensure that the Marketing Cloud server (the push system's source of badge truth) reflects the state of the device.

Brian Criscuolo

Salesforce

Related Topic