简体   繁体   English

是否可以在不通过iOS中的推送通知打开应用程序的情况下更新应用程序图标上的徽章编号?

[英]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.

相关问题 推送通知-应用徽章图标 - Push Notification - App Badge Icon 如何为应用程序图标提供没有编号的通知徽章? - How to give an app icon a notification badge without a number? 推送通知徽章iphone上的错误的应用程序图标 - Wrong app icon on push notification badge iphone 在App未打开时收到推送通知时更新徽章编号 - Update Badge Number when push notification is received when App is not Open Swift-交付应用程序上的本地通知图标徽章编号更新处于后台 - Swift - Local notification icon badge number update on deliver App is in background Phonegap 3.0及更高版本-是否有无需更新通知即可更新应用程序徽章的插件? - Phonegap 3.0 and newer - Is there a Plugin to Update the App Badge without a Push Notification? 如何更新IOS推送通知中的徽章编号? - How to update the badge number in IOS push notification? 在不运行应用程序或不发送推送通知的情况下为iOS应用程序添加徽章? - Badge iOS application without running the app or sending a push notification? 在应用程序处于后台时使用推送通知更新徽章 - Update badge with push notification while app in background iOS推送通知徽章编号超过图标未显示 - iOS push notification badge number over icon is not showing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM