Is it possible to update badge number on app icon without openining app on push notification in iOS?

半腔热情 提交于 2019-12-11 18:08:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!