Push notification 服务辅助进程中未触发推送事件

Push notification 服务辅助进程中未触发推送事件,push-notification,service-worker,Push Notification,Service Worker,按照“处理推送事件”部分在我的应用程序中设置桌面通知系统,我面临一个问题: 当我用Chrome点击“推送”来人工推送通知时,不会出现任何通知。控制台中没有消息 我允许来自网站的通知,服务人员在我的浏览器中安装良好 我的服务人员如下所示: self.addEventListener('push',函数(事件){ console.log(“[Service Worker]已接收推送”。) console.log(`[Service Worker]Push有以下数据:“${event.data.tex

按照“处理推送事件”部分在我的应用程序中设置桌面通知系统,我面临一个问题:

当我用Chrome点击“推送”来人工推送通知时,不会出现任何通知。控制台中没有消息

我允许来自网站的通知,服务人员在我的浏览器中安装良好

我的服务人员如下所示:

self.addEventListener('push',函数(事件){
console.log(“[Service Worker]已接收推送”。)
console.log(`[Service Worker]Push有以下数据:“${event.data.text()}”`)
const title='我的应用程序名称'
常量选项={
正文:event.data.text(),
图标:“pwa/icon.png”,
徽章:“pwa/badge.png”
}
const notificationPromise=self.registration.showNotification(标题、选项)
事件等待(通知承诺)
})
我的服务人员注册(使用npm包)如下所示:

从“注册服务工作者”导入{register}
const applicationServerPublicKey='BI5QCJ0NDNVJDCBytixinCDCP74EGTB3WxUAXRHIVCLDM-MWQPKLLPLHOZLMS3IOINQ6S_HAexCM0UqKMvaYmg'
函数urlB64ToUint8Array(base64String){
常量填充='='。重复((4-base64String.length%4)%4)
常量base64=(base64String+填充)
.替换(/\-/g,“+”)
.替换(/_/g,“/”)
const rawData=window.atob(base64)
const outputArray=新的Uint8Array(rawData.length)
for(设i=0;i
看起来服务工作者中的推送事件甚至没有触发。。。
我做错什么了吗?

我也有同样的问题。我还可以看到事件在中被触发chrome://gcm-internals. 但是仍然没有触发。你找到问题的解决办法了吗?