react-native - 如何使用 react-native-firebase 获取推送通知的数量

标签 react-native push-notification react-native-firebase

我想用 firebase 在 react-native 中设置每手徽章的数量。

firebase.notifications.setBadge(number)

如何获取号码?

最佳答案

您可以使用 firebase.notifications.getBadge(),如文档中所述:https://rnfirebase.io/docs/v5.x.x/notifications/reference/Notifications#getBadge

不过我纳闷了,好像不是收到消息的总数。我认为这背后的想法是,您向 onNotifications 添加(并为每条消息递增)一个 setBadge

但根本问题是(我认为这也是 Thread-Opener 的意思),我如何获得每个应用程序收到的消息总数。应该是可以的,因为Android中还在用: enter image description here

关于react-native - 如何使用 react-native-firebase 获取推送通知的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53854719/

相关文章:

javascript - 我无法从 firebase 检索用户名

android - 是否有任何在 react-native 中实现 JavaScriptModule 的指南?

node.js - 如何在 sails js 中配置 Node 推送服务器?

android - Phonegap 在后台处理推送通知

cordova - 应用程序恢复时如何处理推送通知?

ios - React-Native、IOS、Firebase - 由于 "loop",无法分发到 App Store

Firebase AUTH API 到signInWithPhoneNumber 导致400 错误请求

android - Fresh Detached Expo + RNFirebase 未在 Android 上运行

react-native - 我如何在 React Native 中剪切 View 的一部分

reactjs - 读取react-native-fs中的本地资源