Accelerometer running in background

Hi,


I have done some extensive reading on this subject and it seems an upcoming project may or may not be possible. I am hoping if someone from Apple or an experienced developer can shed some light on this.


As short as possible, this is what the app will do:

Run in background once it's launched to read accelerometer for sudden stops (falls, crash etc) and then bring app to front and complete some processes such as email and communicate with server.


This app loses its purpose if it can't stay alive in the background. From the allowed list of permitted background processes such as audio, news, location updates etc, this doesn't fall into one of those categories per se, but location service can be added to achieve this.


Is there a leeway for this or should I just let them know that it's just not possible?

I'm not sure about accessing the accelerometer is the background per se, but there are at least two problems with your overall strategy:

  • You wrote: then bring app to front

    then bring app to front and complete some processes such as email and communicate with server.

    It is not possible for an app to bring itself to the front.

  • It sounds like you need the ability to process the accelerometer data in real time, which means you need to avoid your app being suspended in the background. It's not possible to do that in the general case. If you have some other reason to remain running in the background, you could look at how the accelerometer APIs behave in that case, but if you don't have such a reason then the question about how the accelerometer APIs behave is irrelevant.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accelerometer running in background
 
 
Q