I'm developing a navigation app which can run in the background. That's working fine thanks to setting UIAccelerometer
to location
. But I'd like to use the accelerometer too, to get some additional information about what the user is doing. However, while in the background, the UIAccelerometer
doesn't call its delegate.
Is there any way to get the current acceleration while being in the background?
I found the solution myself. It is indeed possible to get accelerometer data while running in the background. All one has to do is to rely on the CoreMotion framework rather than on the UIAccelerometer class which, as the name suggests, is a user interface related class.
See this question: How Nike+ GPS on iPhone receives accelerometer updates in the background?