Reset badges count to 0

Comments

4 comments

  • Avatar
    Alexander Spotar

    You should call

     pushNotification.setApplicationIconBadgeNumber(0)
    

    upon resume (ApplicationDidEnterForeground) event to clear the badge value.

  • Avatar
    Naitronet

    Dear,

    var badge = {
    clear: function(){
        pushNotification.setApplicationIconBadgeNumber(0);
    }
    

    }; badge.clear();

    Thx you, i have get that runs fine but there are another problem.

    The badge clears but if i send another +1 pushwoosh always remember the last badge number. For example, if i have badge 1, i enter in the app, and the badge clear, but if i send another +1 push it put in 2.

    There are some command to reset the count totally ?

    Regards

  • Avatar
    Jamesbarnsleyfreelance

    Anyone got a fix for this?

  • Avatar
    Dmitry Dyudeev

    Hello,

    The fix is actually quite easy, I am not sure how we missed this question in March.

    When you increase badge number with "+n", our servers check the latest saved value and add "n" to it. In order to change the value saved on our servers, you should use the "setBadge" request.

    So, when you decrease the badge counter in your application (for instance, when your user reads an e-mail), you should send a setBadge request. This way, everything would work fine.

Please sign in to leave a comment.