【问题标题】:How to send fcm notification using flutter and firebase realtime database如何使用flutter和firebase实时数据库发送fcm通知
【发布时间】:2020-01-02 07:59:42
【问题描述】:

我正在尝试在 node.js 中执行 firebase 实时消息传递代码,但我对如何做到这一点感到困惑? 常量 doc = snap.data() 控制台日志(文档)

const idFrom = doc.idFrom
const idTo = doc.idTo
const messageId =context.params.messageId
// Get push token user to (receive)

【问题讨论】:

    标签: function firebase firebase-realtime-database flutter dart


    【解决方案1】:

    如果我理解你清楚,你可以参考这个回购有 86 颗星 https://github.com/jlcvp/fcm-node
    一个 Node.JS 简单接口,用于连接 Google 的 Firebase Cloud Messaging (FCM),用于 Android 和 iOS 以及 Web 通知和数据推送

    另一个参考文档https://fireship.io/lessons/flutter-push-notifications-fcm-guide/#step-2-send-messages-with-nodejs-backend

    【讨论】:

      【解决方案2】:

      您必须对https://fcm.googleapis.com/fcm/send 进行简单的 REST 调用。您需要在标题中提供授权密钥。身份验证密钥可以从 Firebase 门户派生。请参阅here 了解如何在 Postman 中进行设置,this 帖子在 Python 中提供了等效代码。

      【讨论】:

        猜你喜欢
        • 2018-01-10
        • 1970-01-01
        • 2022-07-29
        • 2021-07-23
        • 1970-01-01
        • 1970-01-01
        • 2019-01-19
        • 2017-10-24
        • 2022-08-22
        相关资源
        最近更新 更多