Frage

I have an IOS application that uses location services.

I know that applications using location services can execute in the background.

However, I don't want my app to run in the background. If the user isn't watching it, it should not power.

Is this going to happen naturally (i.e. something special is needed for apps using location services to continue to operate in the background?)?

If not, what do I need to do to ensure the app using location services suspends when it goes into the background? If so, what? And what would need to be done to restore the app?

Thx

War es hilfreich?

Lösung

No problem - just do nothing. When the user switches away from your app (to another app, or locking the screen) your app will be suspended.

However, to make absolutely sure you don't do any location in the background, use the applicationDidEnterBackground and applicationWillEnterForeground notifications (or the corresponding app delegate methods) to stop and restart location updating.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top