Solution 1:

Nope, you'll have to track this on the server side. If you don't include any value for badge, it will get removed completely.

Of course though this is only if the user receives the notification and the app isn't running/they choose not to launch it. If the user launches the app or already had it running you can do whatever you want in regards to incrementing.

UPDATE March 2014: See comments for a possible update. I haven't done pushes in several years so haven't been able to verify this myself.

Solution 2:

It's sort of possible but there's a trade-off.

You can always send up the unread total as an add-on JSON value as part of the push payload (push ignores keys it doesn't explicitly understand). Once the user opens the app, read the value and adjust the badge programmatically yourself via UIApplication's applicationIconBadgeNumber property.

The problem with doing it that way is that push adjusts the badge value even if the user doesn't open the app (i.e. when they get the notice and the user hits 'Cancel' instead of 'View'). In those cases your badge won't change, but as soon as they run the app (if they hit 'View') then your app can set it right.

Solution 3:

It is now possible to have the client auto-increment the badge using a UNNotificationServiceExtension.

Extensions have the ability to modify notification payloads before iOS displays them. In summary, store a badge counter in UserDefaults and modify the notification's badge count as needed. You'll need to add the App Groups capability to share User Defaults.

Here's a detailed step-by-step guide: https://prodocs.cometchat.com/docs/ios-increment-app-icon-badge-count