Is it possible to run accelerometer of iPhone in background?

后端 未结 3 1228
轮回少年
轮回少年 2021-01-31 12:29

I want to use accelerometer of iPhone to get the log file of accelerometer value (maybe for 24 hours). Is it possible to let accelerometer runs in background while other applica

相关标签:
3条回答
  • 2021-01-31 12:39

    You can do it now, if your app is allowed to run in the background for other reasons. See the Core Motion API's startAccelerometerUpdatesToQueue:withHandler: method here.

    0 讨论(0)
  • 2021-01-31 12:39

    Nope, it is not. You basically can't run anything but a music app in the background.

    You can run the accelerometer while the phone is suspended though.

    See this blog for how to do it: http://marcopeluso.com/2009/08/23/how-to-prevent-iphone-from-deep-sleeping/

    I use this technique in my GPS recording app.

    0 讨论(0)
  • 2021-01-31 12:52

    No, it is presently not possible, at least if you want to distribute your application through the App Store.

    0 讨论(0)
提交回复
热议问题