reactjs - 在同一个 React 本机应用程序中使用 LocalNotificationSchedule 和 Firebase 通知
问题描述
有没有办法在 React Native 应用程序中同时使用 localNotificationSchedule 和 Firebase 远程推送通知?使用https://github.com/zo0r/react-native-push-notification上的公共库表示 AndroidManifest.xml 需要两种不同的服务
<!-- < Only if you're using GCM or localNotificationSchedule() > -->
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!-- </ Only if you're using GCM or localNotificationSchedule() > -->
<!-- < Else > -->
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- </Else> -->
那么我必须选择其中任何一个吗?
解决方案
我自己在使用 OneSignal,但我可以告诉你,如果你想使用本地通知,你需要同时添加两者。
此外,GCM 将在几周内被弃用,因此您不想使用它。只需使用 Firebase 的 FCM。
推荐阅读
- spring-boot - 如何使用 Spring Boot 在 swagger 标头中配置 jwt 令牌
- python - PyQt5 QTablewidget 项目对齐
- drools - 如何在业务流程中循环 Drools
- javascript - Javascript:在某个单词后添加“阅读更多...”
- arrays - 查找动态元素值 .net
- copy - 从最后一行复制数据并将其粘贴到接下来的 6 个空白行中,但它没有通过...您的帮助将是不可避免的
- android - 在android studio中将图标导入可绘制文件夹的正确方法是什么
- node.js - Node.JS 中数组元素的并行计算
- javascript - Firebase 在每次新应用启动时不断收到多个响应
- wordpress - WooCommerce 自定义 bacs 支付网关不保存银行帐户详细信息