我正在關注這個非常明確的tutorial。 不同之處在於,當我到達訂閱與pushManager用戶舞臺當我打電話pushManager.subscribe()我沒有得到來自其地位pending承諾任何迴應所有的作品。 也許我錯過了一些明顯的問題,我的設置,這是如下: if ('serviceWorker' in navigator && 'PushManager' in window) {
當我編寫這樣的代碼時,在向服務工作人員註冊時獲得通知許可。 我想在啓動添加到主屏幕的應用程序後啓用通知,因此我想要防止在向服務人員註冊時顯示通知許可,有可能嗎? if ('serviceWorker' in navigator && 'PushManager' in window){
navigator.serviceWorker.register(pathServiceWorker)
我收到後續錯誤味精在控制檯當我嘗試「添加到主屏幕」 Site cannot be installed: no matching service worker detected. You may need to reload the page, or check that the service worker for the current page also controls the start