对于我正在构建的 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)