-1

I am new in dart and want to create a chrome app that should work on Chromebook.

I need some data to get updated at particular interval even if app is in background or chromebook has just booted/woke up.

Is there any setting or need to do some kind of programming?

1 Answers1

1

If you want to get your background page active it's more complicated...

First you have to add in your permissions "background" else with the window your background page will be immediately inactive (declare permissions)

After that you need to keep your background page alive and for that you should look at the chrome.alarms API and when your alarms is fired you can call your server to retrieve information

Kleak
  • 555
  • 6
  • 8
  • `chrome.alarms` do not keep the page alive, but they will wake it up (and that's what you want) – Xan Aug 24 '15 at 15:23
  • Yes if you want but saying you have to wake up your app to prevent inactivity is a non cense for me. It's for that i have explain my solution in this way – Kleak Aug 24 '15 at 17:42
  • Well, that's just how the [event pages](https://developer.chrome.com/extensions/event_pages) work. They "wake up" (get loaded) when an event happens. However, they get completely unloaded while waiting for the alarm, so I protest against "keep alive". – Xan Aug 24 '15 at 17:44
  • I'm not totally agree with you ! Have you try to put a server inside the background page with the background permissions? – Kleak Aug 24 '15 at 17:47