-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes I receive the following notification "The site has been updated in the background"out of nowhere? #60
Comments
Hi there, The message This behavior is most likely triggered by the user having multiple notifications pings, but only one message to receive. |
Hii, |
Any updates on this issue? I am also experiencing this and hoping for a fix/workaround |
Hey @taufansatrio, Sorry for the delay in getting back to you. The problem wouldn't be in your push code. It's possible our service worker is being overridden by another service worker that's not able to handle the incoming event which is why Chrome shows a forced message instead. Could you please provide the public URL to your site so that we can investigate the issue more? More importantly, please also let us know if you're using any third-party push providers in addition to ours, or if your site installs a service worker. |
Hey @taufansatrio, Our service workers So for example, currently the contents contents of both importScripts('https://cdn.onesignal.com/sdks/OneSignalSDK.js'); Could you try to modify both the contents of importScripts('https://site.com/my-other-service-worker.js');
importScripts('https://cdn.onesignal.com/sdks/OneSignalSDK.js'); We recommend the above approach instead of importing our service worker into another file because our web SDK kicks out other workers that are registered on the root scope and replaces it with our files. Please note that all of this only applies if you're trying to register service workers to the root scope 'https://site.com/other-worker.js'. If you're trying to register a service worker only under a specific sub-directory 'https://site.com/some-subdirectory/other-worker.js', that service worker should not be kicked out (though I could be wrong we haven't really tested that). More about service workers can be read here. |
If anybody else is experiencing the original issue mentioned, I've updated this comment to better explain it. Most likely a second SW issue. |
Documenting all the ways:
can occur: Technically, why it occurs: When our service worker receives a push event, it has to fetch the actual notification from OneSignal's servers, since we have (at this time) not yet implemented the new web push payload protocol. If we successfully fetch a notification, we display it. Otherwise this error occurs if we can't display a backup notification.
|
I have this issue ("This site has been upgraded in the backgrou..") too. I have a service worker for a Web App Install Banner, as specified at https://developers.google.com/web/fundamentals/engage-and-retain/app-install-banners/ The Web App Install Banner calls for the following JS code output by my website to the browser ... How would I modify the above for usage with OneSignal, considering the comment above about OneSignal aggressively overwriting others, and editing the OneSignal[...].js to import. |
I have the same issue with very basic install from OneSIgnal documentation. Safari works normally, but Chrome shows "This site has been updated in the background" |
I have the same problem in flutter web, it seems that there is a conflict between the service workers with flutter and onesignal.
|
@vedmant @miguelmobilat Config Ex: |
Sometimes when I send a notification, I receive the following notification with the content as "The site has been updated in the background".
I never write this text. I think it is an one signal SDK bug. How can I fix this?
The text was updated successfully, but these errors were encountered: