Search code examples
iosaccelerometerbackground-process

Using the accelerometer of an iOS device in background


I would like to detect the small movements of an iPad, such as when it is picked up.

Is that possible to do with the application not running, but just installed? Like if it was running in the background. I know it is possible with the GPS, but I'd like to do it with the accelerometer to make it detect small movements.


Solution

  • Your problem has been issued in several threads all over stackoverflow. Next time you should really use the search function or at least post some code.

    In the meantime check this: From this thread Receive accelerometer updates in background:

    You can not only use accelerometer for fatching data from background,

    And as you say your App registers for location updates , start location manager in forground.

    Implementing Long-Running Background Tasks For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:

    Apps that play audible content to the user while in the background, such as a music player app Apps that record audio content while in the background. Apps that keep users informed of their location at all times, such as a navigation app Apps that support Voice over Internet Protocol (VoIP) Apps that need to download and process new content regularly Apps that receive regular updates from external accessories

    Short Version: It is not possible to ONLY get acceleration data in background.