Question

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?

Was it helpful?

Solution

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?

OTHER TIPS

NO..you won't be able to get UIAccelerometer values in the background..you can get heading and other types of values specific to core location though..

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