如何给应用程序图标的通知徽章没有一个数字? [英] How to give an app icon a notification badge without a number?

查看:104
本文介绍了如何给应用程序图标的通知徽章没有一个数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在苹果的地方和推送通知编程指南第7页还有就是iPhone桌面的截图,应用图标之一具有不包含一些徽章 - 它只是普通的红

On page 7 of Apple's Local and Push Notification Programming Guide there is a screenshot of the iPhone desktop, one of the application icons has a badge which does not contain a number - it is just plain red.

这怎么可能实现这一目标?

How is it possible to achieve this?

推荐答案

我觉得你想要做什么是不可能与当前的通知API。
如果你想在你的应用程序图标显示的徽章,你必须使用徽章关键在你的APNS有效载荷,并为这个键的值必须是整数。

I think what you want to do is not possible with the current notification API. If you want to display the badge on your application icon, you must use the "badge" key in your APNS payload, and the value for this key must be an integer.

即使本地通知API具有相同的限制,您可以用applicationIconBadgeNumber属性更改徽章的价值,但不幸的是,该酒店只接受一个整数。

Even the local notification API has the same limitation, you can change the badge value with the applicationIconBadgeNumber property but, unfortunately, this property only accepts an integer.

看来只有内置的应用程序(如手机应用程序)可以显示不数徽章。

It seems that only built-in apps (such as the phone app) can display a badge without number.

这篇关于如何给应用程序图标的通知徽章没有一个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆