Reputation: 61
When my service worker invokes a secured API that returns content, I do receive an error message, such that The Site has been updated in background. Can anyone please help me out ?
Upvotes: 0
Views: 144
Reputation: 13469
Based from this link, the message This site has been updated in the background
is a forced message from the Chrome browser when the SDK cannot fetch the notification contents to retrieve. Notification contents are not sent to our background worker; instead we receive a signal to display a notification and then we fetch the notification contents from our server.
This behavior is most likely triggered by the user having multiple notifications pings, but only one message to receive.
You may also check this related SO post: Chrome Push Notification: This site has been updated in the background
Generally as soon as you receive a push message from GCM (Google Cloud Messaging) you have to show a push notification in the browser. This is mentioned on the 3rd point in here:
So it might happen that somehow you are skipping the push notification though you got a push message from GCM and you are getting a push notification with some default message like "This site has been updated in the background".
Hope this helps!
Upvotes: 1