Google Chrome Push Notifications not working if the browser is closed?

30,192

Solution 1

According to Can I Use, Chrome and Firefox desktop browsers require the browser to be running for receiving push notifications; mobile browsers typically don't.

Solution 2

The messages should (eventually) get through even if they are sent while the browser is closed, or the device is offline, etc. (And this works for me using https://gauntface.github.io/simple-push-demo/ and other tests.)

Solution 3

Open Settings (in chrome)

Do the following:

> advanced 
    > system >
        "continue running background apps when chrome is closed" 
             >enable

Solution 4

On desktop, browsers need a process running. For example on Mac OS X the browser can have no window open but if you look at the dock, the light underneath icon can be glowing (meaning it has a process running). In the scenario you should receive push messages.

If the browser was completely quit, then push messages won't get through.

The same applies to windows and Linux.

On android you should be receiving the messages regardless of whether the browser is open or not. This is in part (as far as I know) to the fact that android manages it's connection to the push service rather than the browser, so it'll receive messages whenever possible.

Solution 5

I worked on demo to provide push notifications on Google Chrome and Firefox. Demo -> https://twitter.com/d_danailov/status/1163824171480166400

If someone has a question could ping me on twitter.

The public URL: https://push-notifications-ddanailov.firebaseapp.com/

Repo: https://github.com/dimitardanailov/push-notifications

Push notifications

Share:
30,192

Related videos on Youtube

Rajat Sharma
Author by

Rajat Sharma

Working as a Javascript Full-Stack Lead in a reputed company.

Updated on July 21, 2022

Comments

  • Rajat Sharma
    Rajat Sharma almost 2 years

    It is written here that the push notifications will work even if the browser is closed, but I tested it and it is not the case. I receive push-notifications only if the browser is open (doesnt matter if the particular webpage is open or not).

    I tested this on chrome for Desktop & chrome for Android (after updating to latest version).

    my question is :- For push notifications to work should the browser be open?

    Note:- I used this for testing.

    • Kevin Farrugia
      Kevin Farrugia over 7 years
      I have tested the link you provided and it works well. Tested by opening the website, allowing for push notifications, closing Chrome and then triggering a push request using curl.
    • Rajat Sharma
      Rajat Sharma over 7 years
      @KevinFarrugia on which platform did you test? I had tested on windows 10 and Android M. For me it didnt work when the browser was closed.
    • Kevin Farrugia
      Kevin Farrugia over 7 years
      Tested on Android M
    • fuglede
      fuglede about 4 years
      The other comments suggest that on Android, Chrome and Firefox will show push notifications even if the browsers are closed, but in my experience what can happen is that the notifications will arrive, but only appear once the browser is reopened (Chrome for Android 80, Firefox for Android 68). Certainly doesn't seem reliable.
    • sçuçu
      sçuçu about 3 years
      Well, it seems the situation is same for most platforms. On mobile devices, android, no requirement for browser to be open to receive push notificaitons, but on desktop oss a running browser is necessary. It would be great if on desktop oss, and others, too the reception of the push messages could be handled by a platform's own service related to background tasks or push notifications jobs then handed to web service workers (waking them up if needed) so that we don't need a running browser at that time. It is the case in android via Google Play Services, afaik.
  • Mohamed Hussain
    Mohamed Hussain almost 5 years
    thanks Matt for the answer and Push notification online demos ...Is this still applied for 2019?
  • Matt Gaunt
    Matt Gaunt almost 5 years
    I believe this is still the case yes.
  • asdfasdfasdf
    asdfasdfasdf over 3 years
    Same is the case for Microsoft Edge (Chromium based) on the desktop.
  • Billy
    Billy over 3 years
    thx, I can confirm this works with Chrome 85. The (previously sent) notification will be delivered when the browser is started or reconnected to the network.