8

Does anybody know how to implement receiving of push notifications outside and without running browser?

TakinosaJi
  • 400
  • 5
  • 13

3 Answers3

13

There is some nuance to this:

  • Chrome for Android: Push messages will wake up the Service Worker and Web App even if the browser is closed. This is the default and our ideal position across all platforms

  • Desktop Chrome: Push works and will wake up the service worker if the browser is still open. However it will not work if the browser is closed. You can force the browser to remain open if you have a Chrome App that is set to run in the background. Other than that we (the Chrome team) are working out how we enable this by default on Windows, Mac and Linux.

  • Chrome for iOS: Push just does not work on this platform

Kinlan
  • 16,315
  • 5
  • 56
  • 88
  • Hello! I was wondering if you might take a look at a question I posted here regarding Web Push (specifically push w/o an actual notification). http://stackoverflow.com/questions/33092065/google-chrome-silent-push-notifications/33092227#33092227 – Ruben Martinez Jr. Oct 13 '15 at 01:43
  • 2
    Chrome can be configured to run in the background with _Continue running background apps when Google Chrome is closed_ setting. Does it apply also to Service Workers or just to Apps and Extensions? – Martin Ždila Sep 13 '16 at 17:44
  • @Kinlan "Chrome for iOS: Push just does not work on this platform" - this is weird, actually. iOS supports Push for native Apps. Chrome is a native App. Shouldn't Chrome dev. team be able to implement anything related to push? – Srg Oct 03 '16 at 11:31
2

Chromium blog has a post with code examples: http://updates.html5rocks.com/2015/03/push-notificatons-on-the-open-web

And the documentation was updated too: https://developer.chrome.com/apps/cloudMessaging

oberhamsi
  • 1,303
  • 8
  • 18
1

It is possible to write Chrome extension where background script can run if Chrome is allowed to run in the background (configurable in settings) and it can use GCM.

Martin Ždila
  • 2,998
  • 3
  • 31
  • 35