【问题标题】:Firebase Messaging "This site has been updated in the background." Instead of Actual NotificationFirebase 消息“此站点已在后台更新。”而不是实际通知
【发布时间】:2018-12-26 02:24:31
【问题描述】:

我想使用 Firebase 向网络浏览器发送后台推送通知。收到推送通知,但 Chrome 不理解该通知。消息“此站点已在后台更新”,而不是显示实际的标题和正文。出现。我做错了什么?

我的 service worker 是一个空文件。

使用 Admin API 在 Cloud Function 中编写代码:

var res = await admin.messaging().send({
  "notification": {
    "title": "Background Message Title",
    "body": "Background message body"
  },
  "topic":"Test"
});

【问题讨论】:

    标签: javascript node.js firebase firebase-cloud-messaging


    【解决方案1】:

    因为您的服务工作人员是空文件,所以您不处理 message 事件并且浏览器正在显示默认消息。

    【讨论】:

      猜你喜欢
      • 2015-09-15
      • 2021-08-03
      • 2016-09-22
      • 1970-01-01
      • 1970-01-01
      • 2019-01-10
      • 1970-01-01
      • 1970-01-01
      • 2012-05-27
      相关资源
      最近更新 更多