【问题标题】:Firebase Notification in UnityUnity 中的 Firebase 通知
【发布时间】:2017-06-06 04:37:22
【问题描述】:

我正在为我的 Unity 项目使用 Firebase 消息传递。我在 Firebase Unity Reference 中看到有 Notification 的文档。 https://firebase.google.com/docs/reference/unity/class/firebase/messaging/firebase-notification

我是 Unity 新手,如何将 Firebase 通知添加到项目中,以便在收到消息时推送通知。

【问题讨论】:

  • 要求推荐或查找书籍、工具、软件库、教程或其他非现场资源的问题对于 Stack Overflow 来说是题外话,因为它们往往会吸引固执己见的答案和垃圾邮件。取而代之的是describe the problem 以及迄今为止为解决该问题所做的工作。

标签: c# firebase unity3d push-notification firebase-cloud-messaging


【解决方案1】:

我找到了一个答案是将notification json 添加到POST 中,这样firebase 会在收到消息时推送通知。

{
"data": {
    "title": "This is my first unity project"
},
"to": "<tokenid>",
"notification": {
    "title": "Your Title",
    "text": "Your Text"
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多