问题
iOS 8 or 9
When I get push notification in my iOS app I want to update the badge number (count in red) shown on the app icon without opening the app.
Currently it gets updated only and only once the app is opened.
Is that possible?
回答1:
You need to set a value for the badge key in your push notification payload. Payload Notification
The payload contains information about how you want to notify the user, such as using an alert, badge or sound. It can also contain custom data that you define.
To remove the badge, set the value of this property to 0.
来源:https://stackoverflow.com/questions/34693473/is-it-possible-to-update-badge-number-on-app-icon-without-openining-app-on-push