iOS 7.1: Get Core Motion data (accelerometer, gyroscope) while app is in background

橙三吉。 提交于 2020-01-01 05:22:26

问题


I am wondering how I can keep receiving motion sensor values while the app is in background mode. I realize that there are already several posts out there. For example, I have tried How Nike+ GPS on iPhone receives accelerometer updates in the background? which does not work for me.

I have also enabled background modes (location updates at the moment) in my App-Info.plist.

Are there any working examples out there? Also, if possible, I would not want to implement some of the hacks, e.g. play silent audio or get the user's location. Apps such as SleepCycle seem to be able to have achieved this without any workarounds.

I'd be grateful for any help.

来源:https://stackoverflow.com/questions/22459684/ios-7-1-get-core-motion-data-accelerometer-gyroscope-while-app-is-in-backgro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!