【问题标题】:Remote push notification heads-up not working in react native when app is in background state (Android)当应用程序处于后台状态(Android)时,远程推送通知提示无法在本机反应中工作
【发布时间】:2021-01-22 09:14:26
【问题描述】:

我已经使用 Firebase 库集成了推送通知。低于库规范,

"@react-native-firebase/messaging": "^10.5.0",
"react-native": "0.63.4",

当应用程序处于后台状态时,收到推送通知但它没有在屏幕上弹出。 当应用程序处于后台状态时,我需要对提醒推送通知进行哪些设置。

【问题讨论】:

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


    【解决方案1】:

    尝试使用 firebase 控制台或邮递员发送通知,如果您仍然无法收到通知,那么您的 sdk 设置不正确。邮递员使用此链接 https://fcm.googleapis.com/fcm/send 和参数:

        {
           "to" : "your_token",
           "collapse_key" : "type_a",
           "notification" : {
            "body" : "Body of Your Notification",
            "title": "Title of Your Notification"
                        }
        }
    

    和标题:

          Authorization:server_key
          Content-Type:application/json
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-18
      • 1970-01-01
      • 1970-01-01
      • 2015-08-31
      • 1970-01-01
      相关资源
      最近更新 更多