问题描述
我想在带有 firebase 的 react-native 中设置每只手的徽章数量.
firebase.notifications.setBadge(number)
如何获取号码?
您可以使用 firebase.notifications.getBadge()
,如文档中所述:
I want to set the count of the badge per hand in react-native with firebase.
firebase.notifications.setBadge(number)
how to get the number?
you can use firebase.notifications.getBadge()
, like described in the Docs: https://rnfirebase.io/docs/v5.x.x/notifications/reference/Notifications#getBadge
But I wonder, it doesn't seem to be the total of received messages. I think the Idea behind this is, that you add (and increment for each message) an setBadge
to your onNotifications
.
But the question at all (I think thats also what the Thread-Opener means), how do I get the total number of received messages per app. It should be possible, because it's still used in Android:
这篇关于如何使用 react-native-firebase 获取推送通知的计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!