PushManager订阅承诺永远不会实现或拒绝 [英] PushManager subscription promise never fulfill nor reject
问题描述
我当前遇到某些Chrome(Chromium)版本的问题,其中ServiceWorker的PushManager.subscribe
承诺处于待处理状态.
I am currently facing an issue with some Chrome (Chromium) version where the PushManager.subscribe
promise from a ServiceWorker stays in a pending state.
代码本身非常简单:
return serviceWorkerRegistration.pushManager.subscribe({
userVisibleOnly: true
});
我有一个有效且可访问的JSON 清单,其中提供了 GCM发件人ID .我还尝试了不同的实现方式,如这篇文章中所述,但是结果还是一样.
I have a valid and accessible JSON manifest, providing the GCM Sender ID. I also tried different implementations, as described in this post, but the result is still the same.
订阅部分与每个 47 + 版本均兼容,该问题在较早的版本中出现. (我正在使用Chromium连续构建来测试不同的主要版本.
The subscription part works well with every 47+ version, the issue appears with older releases. (I'm using Chromium continuous builds to test the different major versions).
还请注意,在Ubuntu上使用Chromium 46(及更低版本)时,诺言会在15分钟后使用Internal Server Error
拒绝.
Also note that, while using Chromium 46 (and below) on Ubuntu, the promise rejects after 15 minutes with an Internal Server Error
.
推荐答案
It appears that the Chromium Team was working on it. If I'm not mistaken, a fix will be release on Chrome 55
这篇关于PushManager订阅承诺永远不会实现或拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!