简体   繁体   中英

swift 3 read accelerometer data when app is in background

I am trying to read accelerometer data for indefinite time when the app is in background. By default apple only provides 3 minutes to run any task in background.

I read many post on stack regarding this. All suggested either to use background modes such as Location, Audio etc or use timer. But at same time there are chances of app getting rejected using these techniques as either they are directly not required in my app or are a hack.

I just need to read accelerometer data and store locally. Is there any way to do this without risk of app getting rejected.

Turn on background modes for location in capabilites 在此处输入图片说明

Refer to hannes comment ! on this How Nike+ GPS on iPhone receives accelerometer updates in the background?

There is always a chance of rejection but refer this link may be you will need to provide a disclamer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM