I'm using the Distriqt PushNotifications ANE and PARSE to send PushNotifications, and so far everything is working PERFECTLY.
This means, I register my iOS devices and receive PushNotifications as it should be....
When I send PushNotifications with PARSE I use the badge:"Increment" value, which understandably increments the Value By +1.
After I open the App, I want to reset the BADGE to be at 0 and I use the setBadgeNumber(0) method... This also works, I tried with other values like 11, or 1 and it displays it correctly.
The Problem is that when I send another PARSE notification it displays now the old value + 1 !!!
Like so:
- I use PARSE to send 3 PushNotifications
- The badge displays (3)
- I use the setBadgeNumber(0)
- The badge displays (0)
- I use PARSE to send 2 additional PushNotifications
- The badge displays (5)!!!!
How can I really reset the badge?
The value of the badge is actually sent as part of the push notification payload, eg:
You should double check what Parse is actually sending as it will be keeping a count of the notifications and sending that as part of the payload, so you will either need to disable this in Parse or notify Parse of your user resetting / changing the count.
Calling
setBadgeNumberjust changes the icon on the application and doesn't update Parse of this change.You could look into the Parse ANE which helps out with this process:
http://airnativeextensions.com/extension/com.distriqt.Parse