How to reset iOS Push Notifications Icon Number in Parse?

I am using the Parse iOS SDK. I have a problem resetting the icon counter. I use the tutorial code (parse) to send push notifications. I use increment for the icon, but the score of the icon continues to increase. I am resetting the icon score in applicationDidBecomeActive: a method like this,

- (void)applicationDidBecomeActive:(UIApplication *)application { 

    PFInstallation *currentInstallation = [PFInstallation currentInstallation];

    if (currentInstallation.badge != 0) {
        currentInstallation.badge = 0;
        [currentInstallation saveEventually];
    }

// ...
}

It just resets the icon number locally. But the next time I send a push notification, it simply increases the previous value of the account and displays it. I assume that the icon number in the Parse server is not getting reset. In addition, I tried to use [currentInstallation saveInBackground];, but it does not work either. Help

+4
1

if- ( api):

PFInstallation *currentInstallation = [PFInstallation currentInstallation];
currentInstallation.badge = 0;
[currentInstallation saveEventually];

, installation.badge != 0 .

.

+2

All Articles