【问题标题】:Using LocalNotificationSchedule and Firebase Notfication in same React native app在同一个 React 本机应用程序中使用本地通知计划和 Firebase 通知
【发布时间】:2019-07-31 12:46:21
【问题描述】:

有没有办法在 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> -->

那么我必须选择其中一个吗?

【问题讨论】:

    标签: reactjs firebase react-native push-notification firebase-cloud-messaging


    【解决方案1】:

    我自己在使用 OneSignal,但我可以告诉你,如果你想使用本地通知,你需要同时添加两者。

    此外,GCM 将在几周内被弃用,因此您不想使用它。只需使用 Firebase 的 FCM。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-29
      • 1970-01-01
      • 1970-01-01
      • 2021-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多