Question

I was wondering how some existing apps refresh their application data while the app isn't running. Lets say we have a rain alarm application. This application send you a (local?) notification when its about to rain in your current location or location you've manually entered. What's the best way to achieve something like this?

Is the application getting weather data on the device itself (even when the application is killed) to send a local notification when its about to rain? Doesn't this method drains the battery of my device?

Or do I need to create a standalone application which runs 24/7 and always checks the weather? It then searches a database to see who's device needs a remote notification.

Other methods are also appreciated.

Was it helpful?

Solution

In iOS6 and before, your app cannot run all the time you want in the background, the system will stop the app after a few seconds.

A way that your example can be achieved is sending push notifications from a remote server.

Note: In iOS7 it will be possible to wake you app when a notification is received and download content.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top