Push notifications with negative badge value in iOS 10 is not working

I have an app which handles the push notifications and based upon the badge value, I am perfoming some functionality. This approach was working till iOS 9 but my iOS 10 device is not being able to handle such notifications which have a negative badge value. However, the same push notification with a positive badge value is working fine on both the versions of iOS. What might be the reason for such a behaviour on iOS 10?? Is it a newly imposed restriction? Is there any workaround to handle such pushes?


Thanks in advance!!

Based upon your description, it might be a newly imposed restriction. Even if it is a new restriction, you shouldn't be storing a negative badge value since Apple doesn't specify how it will be handled.


If you need to pass down a value to perform some functionality, you should pass that down as additional metaData outside of the aps block.


EX: You can grab the value for "storedValue" and use that within your app.

{"APNS_SANDBOX":"{\"storedValue\":-4,\"aps\":{\"alert\":\"my push message\", \"badge\":4}}"}


Hope this helps,

DT

Push notifications with negative badge value in iOS 10 is not working
 
 
Q