I want to build a Chrome App to listen notifications sent by my Lab, and I don't want to open a Chrome window(just let the app run in background silently, and pop a box when I have a new message). But sockets api is only for packaged app, and packaged app has no background permission, what should I do? Thx.
-
What kind of notifications are you sending? chrome.pushMessaging and chrome.gcm (see developer.chrome.com/apps/gcm) receive notifications even if the app is not running.Dinh Viêt Hoà– Dinh Viêt Hoà2014-03-11 20:14:54 +00:00Commented Mar 11, 2014 at 20:14
-
Thx Dinh, our Lab doesn't connect to the Internet, so I guess GCM can't help me. Thx again.Sneezry– Sneezry2014-03-12 04:28:09 +00:00Commented Mar 12, 2014 at 4:28
1 Answer
(Quick answer, will edit later with more info.)
Chrome Packaged Apps don't need that permission, they have a background page by default. Most (say, 99% of existing) chrome apps will open a window when they launch, but thats optional.
If your app has an open window, the runtime will keep your application running an not move into an idle state. However, if you are using certain APIs, such as having an open TCP server socket listening for incoming connections, its very unlikely that the runtime will shut your app down unless the system is under serious constraints.