0

We have an app that runs in the background, which calls an URL every 15 minutes, but when the phone is turned off and turned on, we want to open the app automatically and resume calling the URL, is this possible???

This is an app that gives a local notification to the user that a website content has changed, when the content has been changed by the admin, that is the reason...

i think this is possible for location services and voip, but what are the conditions before we do this and how to do this?

any help will be much appreciated, thanks in advance...

grk
  • 5
  • 8
  • Why? If the user isn't using the app why does it need to be doing this in the background? – Wain Dec 30 '13 at 15:54
  • Thank you, this is an app that tell the user that a website content has changed, when the content has been changed by the admin, that is the reason... – grk Dec 31 '13 at 05:08
  • Then some server should be doing the checking and sending out push notifications when changes are detected... – Wain Dec 31 '13 at 07:48

2 Answers2

0

There is a way to do this intended for voip apps by setting your app's UIBackgroundMode to include the voip value. See the Apple Documentation on that for more info, but here is the excerpt about what the voip flag does for you:

The app provides Voice-over-IP services. Apps with this key are automatically launched after system boot so that the app can reestablish VoIP services. Apps with this key are also allowed to play background audio.

If your app is a voip app, then this is what you need. If your app is not a voip app I don't know if this change will make it past Apple's review since that flag is really meant for voip apps.

foggzilla
  • 1,705
  • 11
  • 15
  • Thanks for the answer, but our app is not voip like, but it needs to be run every 15 minutes to get updated data from the url, will the app be rejected if we give the background key as voip... – grk Dec 30 '13 at 14:48
0

use location services and the app is kept running and is restarted so as to get location infos (but be aware that this drains battery and will not be liked by apple/users :D)

[[CLLocationManager sharedManager] startMonitoringSignificantLocationChanges];

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135
  • Thank you, how to make the app restart when the phone is switched on even if it is location service, where and what need to be specified, pls help? – grk Dec 31 '13 at 05:09
  • no need to specify anything see edited answer – Daij-Djan Dec 31 '13 at 09:15