开发者

CLLocation to work in sleep/screen lock mode (iOs < 4.0)

开发者 https://www.devze.com 2023-01-22 19:58 出处:网络
I need to get the user\'s location even if the phone goes to sleep/screen lock mode. I\'ve tried enabling location services in background mode by adding key to the info.plist file, but this method req

I need to get the user's location even if the phone goes to sleep/screen lock mode. I've tried enabling location services in background mode by adding key to the info.plist file, but this method requires iOS >= 4.0. Is there any alternate method to get the location manager working in screen lock mode开发者_如何转开发


Yes. Have a look at this: http://github.com/marcop/iPhoneInsomnia

It keeps the iDevice awake by registering your app as an audioplayer and playing a silent sample every 5 seconds. AFIK, this is the only way to do it in iOS < 4.0.

It seems like a hack, so I don't know what Apple thinks of it, still there are a lot of apps in the AppStore that apparently does this.

0

精彩评论

暂无评论...
验证码 换一张
取 消