开发者

Running location services in the background on an older 3G iphone

开发者 https://www.devze.com 2023-03-11 18:39 出处:网络
I 开发者_如何学JAVAhave a location based application that needs to run in the background.I have several iPhones that I am testing on including a older 3G.I register my app to need background location

I 开发者_如何学JAVAhave a location based application that needs to run in the background. I have several iPhones that I am testing on including a older 3G. I register my app to need background location based services and everything works as advertised accept with the older 3G phone. When you press the lock button, it does an applicationWillResignActive: as expected, unfortunately the phone immediately goes into low power mode and that is that. When you have the phone tethered with the USB cable, and then press the lock button, the 3G phone stays alive and correctly reports location changes. When it is disconnected, it goes immediately into low power mode.

The strange thing is that I am pretty sure that it used to work. I want to see if anyone out there has an app running on an older iphone (3G) which registers for location services and is not immediately put into lower power mode when the lock button is pressed. If so, what am I doing wrong.

I followed all the directions, have locations in my Info.plist.

Thanks for your help!

Cheers, Bryan


I think you are seeing expected behavior.

I noticed on a recent trip with my old 3g the Location Manager appeared to remain active only when the usb supplied power. On usb, unlocking the phone would bring the app up (google maps in this case) immediately with Location Manager active. Without usb, I had to relaunch Location Manager each time I unlocked the phone.

I strongly suspect this is safety/power-saving feature. The Location Manager sucks battery life at a startling rate, especially on older devices. By running the Location Manager continuously while on battery, you could easily flatline a user's phone without their knowledge.

I would be very leery of any design that requires the Location Manager to run continuously in the background. Test it throughly.

You don't want the economic consequences of users deciding that "when I use Bryan's app, my battery mysteriously dies" or the moral consequences of leaving someone in an emergency without a working phone.

0

精彩评论

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