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

前端 未结 8 1859
一生所求
一生所求 2020-12-29 05:45

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 brow

相关标签:
8条回答
  • 2020-12-29 05:58

    Yes, the other users are right and there is no way to receive them on Windows if the browser is closed unless the browser is running in the background, which some Chrome Apps and Extensions can force. I ran into this recently and found this extension, which I believe may help. It keeps the browser running in the background even if the windows are closed but does not do anything besides that (it is open source and presumably the version uploaded to the Chrome Store matches that version)

    https://chrome.google.com/webstore/detail/lightning-reopen/ahphokgmcecbjeipkfkamcdmemghkaph

    0 讨论(0)
  • 2020-12-29 06:07

    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.)

    0 讨论(0)
  • 2020-12-29 06:08

    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.

    0 讨论(0)
  • 2020-12-29 06:08

    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.

    0 讨论(0)
  • 2020-12-29 06:14

    On desktop the browser needs to be running since that is the process that receives the push messages. Some extensions, like hangouts force the browser to keep running even when the last tab is closed so for users with one such extension installed push will work all the time.

    On Android, the browser does not need to be running since the entity in charge of receiving the messages is baked into Google Play Services.

    The Chrome team is working on the desktop issue in https://bugs.chromium.org/p/chromium/issues/detail?id=402456

    0 讨论(0)
  • 2020-12-29 06:15

    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

    0 讨论(0)
提交回复
热议问题