小编Pet*_*man的帖子

我收到了 Web 推送错误代码状态 403,这让我很抓狂,因为它告诉我要使用 firebase。这是怎么回事?

对于我正在构建的 PWA,我不断收到来自 Chrome 的 WebPush 错误(状态代码 403),并且正文说我需要使用来自“firebase 控制台”的 VAPID 服务器密钥,但我使用了节点 Web-Push 库来生成VAPID 密钥,发生了什么事?我是否必须使用 firebase 在 Chrome 中构建 PWA?

这是我发送推送通知时从浏览器收到的错误消息:

  name: 'WebPushError',
  message: 'Received unexpected response code',
  statusCode: 403,
  headers:
   { 'content-type': 'text/plain; charset=utf-8',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'SAMEORIGIN',
     'x-xss-protection': '0',
     date: 'Thu, 31 Oct 2019 19:59:02 GMT',
     'content-length': '194',
     'alt-svc':
      'quic=":443"; ma=2592000; v="46,43",h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000',
     connection: 'close' },
  body:
   'the key in the authorization header does not correspond to the sender ID used to subscribe this user. Please ensure …
Run Code Online (Sandbox Code Playgroud)

web-push progressive-web-apps

5
推荐指数
1
解决办法
727
查看次数

标签 统计

progressive-web-apps ×1

web-push ×1