크롬을 사용하여 알림을받는 서비스 근로자가 인데 파이어 폭스와 함께 수신하지 않습니다.GCM (Google 클라우드 메시징)이 파이어 폭스와 작동하지 않습니다.
푸시 리스너가 (그것을 디버깅에 의해) 파이어 폭스에 모두 해고되지 않고,
PS : 서비스 노동자가 성공적으로 등록되어 있지만 알림이 수신되지 않는 경우입니다.
내 코드의 문제점은 무엇입니까?
이 documentation에서 기반self.addEventListener('install', function (event) {
event.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', function (event) {
console.log('Activated', event);
});
self.addEventListener('push', function (event) {
event.waitUntil(
fetch('/path', {
credentials: 'include',
method: 'post',
})
.then(function (response) {
return response.json()
.then(function (data) {
return self.registration.showNotification(data.title, {
body: data.body,
icon: '/images/image.png',
});
});
})
.catch(function (error) {
console.error('wrong', error);
})
);
});
답장을 보내 주셔서 감사합니다. 그러나 Google gcm 문서를 사용하여 알림을 보내고 있으며이를 Firefox와 통합하려고합니다. https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web?hl=en –