[英]Is it possible to update badge number on app icon without openining app on push notification in iOS?
iOS 8 or 9 iOS 8或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. 当我在iOS应用中收到推送通知时,我想更新应用图标上显示的徽章编号(红色计数),而无需打开应用。
Currently it gets updated only and only once the app is opened. 目前,它仅在打开应用程序后才更新。
Is that possible? 那可能吗?
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. 要删除徽章,请将此属性的值设置为0。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.