Ankur Saxena
Ankur Saxena

Reputation: 61

Error Message while receiving GCM

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 ?enter image description here

Upvotes: 0

Views: 144

Answers (1)

abielita
abielita

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:

https://developers.google.com/web/updates/2015/03/push-notificatons-on-the-open-web#what-are-the-limitations-of-push-messaging-in-chrome-42

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

Related Questions