How to save accelerometer data in the background on iOS?
<p>I am developing an activity recognition/tracking app that provides the user with statistics and a timeline of their day. I currently have a working version for iPhone 5S and above that uses the M7 and M8 motion co-processor to query activity for the past day or time period.</p>

<p>I am now attempting to develop a version that is supported by older phones such as the iPhone 5 and 5c (without the M7/M8 motion co-processor). My idea is to save accelerometer readings for a period of time, and send them to a server to be classified, but I cannot get the app to stay alive in the background for longer than a few minutes in order to detect and save these readings.</p>

<p>I have used CLLocation updates to attempt to keep the app alive in the background, but like our version for newer phones, it only wakes the app up for about 10 seconds on each location update rather than keeping it running continuously in the background.</p>

<p>I am also aware of tricks/hacks that can be used to such as registering for the Audio or VOIP background modes but this will only get our app rejected by Apple's review system if those modes aren't used for a user-facing feature.</p>

<p>Other answers on Stack Overflow vary from saying that it's not possible at all, to saying that it's easy when using location updates - any idea what I am missing here?</p>

<p>There are apps on the App Store such as Moves and Human that work for iPhones without the M7/M8 motion co-processor - does anyone have any idea how these work?</p>