web-push


How should I handle the pushsubscriptionchange event?


According to the spec, a pushsubscriptionchange event indicates that "a push subscription has been invalidated, or will soon be invalidated." What are the best practices for handling this event?
Process the re-subscription entirely within the service worker. There may be no client (i.e. open pages) associated with the service worker at the point the event is fired--do not use postMessage() to trigger a re-subscription from the client.
Implementations are likely to honour the old subscription for a period of time (probably days). Whilst the spec makes no such guarantee, it is likely that implementations will support both old and new keys for some time to reduce/eliminate the chance of messages being dropped because one of the clients or servers involved hasn't received the "new" key.
As of April 2016 neither Chrome nor Firefox fires this event. However, since it's in the spec, to ensure users continue to receive messages, you should make sure you handle it correctly.

Related Links

My Pushpad Sender does not send any more notifications
Pushpad or Web push notification how to custom dialog message
What is VAPID and why is it useful?
How can I test pushsubscriptionchange event-handling code?
How should I handle the pushsubscriptionchange event?
How can I hide notifications my site is displaying if it is focused and brought to the foreground?
Do I need to show a notification in response to a push notification if my site is foreground and focused?
Getting customized message from GCM using Web push notifications
Firefox Push API - AbortError: Error retrieving push subscription

Categories

HOME
jboss
office365
ionic2
android-espresso
typelite
dronekit-python
port
azure-logic-apps
game-maker
grocery-crud
freertos
global-variables
fresco
twisted
maven-plugin
xsl-fo
spam
adobe-illustrator
pfobject
clr
pe
tableview
web-analytics
intel
channel
exchange-server-2010
cell
react-dnd
dragula
router
tf-idf
basex
react-bootstrap-table
bonita
guice
commonsware-cwac
db2-luw
grails-2.5
subclassing
numerics
jslint
xvfb
forms-authentication
fastlane
newtons-method
access-denied
dbcc
julius-speech
apache-toree
moinmoin
flume-twitter
axis
autorelease
cyanogenmod
webalizer
django-static-precompiler
sony-future-lab-n
karabiner
renderman
extjs4.1
iptv
dynamics-crm-4
front-camera
http4s
petsc
java-2d
cdo.message
qpixmap
noclassdeffounderror
sharepoint-apps
gwt-syncproxy
onepage-checkout
wikimedia-commons
gdl
json-spirit
outlook.com
fanotify
bootstrap-wysiwyg
alwayson
kefir.js
scala-macros
htmltidy
mod-auth-openidc
phonegap-facebook-plugin
symja
configurable-product
ildasm
nesper
iplimage
qt5.4
berkeley-db-xml
nidaqmx
treeline
accessory
bittorrent-sync
spring-security-acl
mp4parser
ember-table
ldif
void-pointers
bcdedit
jquery-dialog
pageheap
struts2-s2hibernate
image-scanner
kobold2d
gwt-celltable
tablet-pc
printqueue
gaelyk
eaccelerator
icicles
oracle-pro-c
html-components

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App