Continuous accelerometer updates while in the background on iOS Continuous accelerometer updates while in the background on iOS ios ios

Continuous accelerometer updates while in the background on iOS


Considering this was asked 3 years ago, I'm going to try and give a response applicable to 2017. If you are using Swift I would strongly suggest using this framework https://github.com/MHaroonBaig/MotionKit.

It makes it very trivial to use CoreMotion services. There is probably another friendly wrapper for Core Location services.

I found another SO question that seems to have answered this using your approach of hijacking location services to stay active in the background.

Run app for more than 10 minutes in background

Hopefully this helps. I'll just leave a word of caution that using location services to get continuous accelerometer data in the background without actually needing the location services would probably be grounds to have your app rejected from the app store. Navigation apps genuinely use both location and accelerometer data. The simple answer would be to add a feature that actually uses the location to justify getting the accelerometer data in the background. Anyway, best of luck.