How to display notification count on icon in react native?

匿名 (未验证) 提交于 2019-12-03 01:33:01

问题:

How do you display notification count on an icon with react native like photo?

回答1:

Setting a badge number is only supported on iOS. To imperatively set the badge number you can use e.g. PushNotificationIOS.setApplicationIconBadgeNumber. See how to set up PushNotificationIOS in the RN docs.

There are also a number of 3rd party libraries available to accomplish this, with push notification handling for both Android and iOS, should you need that.

Although "vanilla" Android does not support badge numbers, the same effect can be achieved by using a widget or a custom launcher. For further info, see this question.



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