【问题标题】:react-native-fcm don't receive notification when app is opened打开应用程序时react-native-fcm没有收到通知
【发布时间】:2018-07-01 17:48:46
【问题描述】:

为什么我在打开应用时收不到 react-native-fcm 的通知?

这是我的有效载荷

const proState={};
       proState.notiUID=recKey;
        proState.notiPayload={
          data: {
            senderKey:senderKey,
            id: senderKey+':chat',
            type: 'chat'
          },
          notification: {
            title: proState.senderSnap.fullname,
            body: proState.lastmsg,
            sound: 'default',
            id: senderKey+':chat',
            tag : senderKey+':chat',
            priority : "high",
            data: senderKey
      },
        };


  const optionss = {
    priority: "high",
    show_in_foreground: true
};

return admin.messaging()
        .sendToTopic(proState.notiUID, proState.notiPayload,optionss)

我只在应用最小化或关闭时收到通知

【问题讨论】:

    标签: react-native push-notification react-native-fcm


    【解决方案1】:

    您在 android 和 ios 这两个平台上都面临同样的问题?如果您仅在 ios 中遇到此问题,请不要担心 ios 不会在前台收到通知。这是ios的默认行为。

    【讨论】:

    • android 我是否遇到过这个问题,但尚未在 ios 上测试
    • OK 然后测试它没有 ios
    猜你喜欢
    • 1970-01-01
    • 2016-09-29
    • 2021-08-18
    • 2019-06-15
    • 1970-01-01
    • 1970-01-01
    • 2018-08-01
    • 2020-08-21
    • 2021-03-26
    相关资源
    最近更新 更多