MIPs
no leída,16 jun 2011, 17:03:0616/6/11Iniciar sesión para responder al autor
Iniciar sesión para reenviar
No tienes permiso para eliminar mensajes de este grupo
Mostrar el mensaje original
Las direcciones de correo electrónico de este grupo son anónimas o necesitas el permiso para ver las direcciones de correo electrónico de los miembros para poder ver el mensaje original
a phon...@googlegroups.com
I have an app that is using geolocation services (PhoneGap 0.9.5.1 on iOs 4.3).
It is designed to run in background as it tracks the user. So I have used "App registers for location updates". That works fine and even if the user runs another app, mine keeps logging their location as designed.
When the app starts it has to immediately start using Geolocation to enable the GPS and get an accuracy reading. The user then starts the tracking when they are ready. When they have finished, they can stop tracking, but the app needs to continue to access Geolocation services in case they start again and to maintain the GPS lock.
But of course the battery usage is terrible. That is fine when the user wants the app to track their location, but once they have completely finished how do I turn off Geolocation when the app moves into background?
I have intercepted the "pause" event and at that point clear the interval function that is calling navigator.geolocation.getCurrentPosition() if they are not tracking at the time, renabling on "resume", but the icon showing Geolocation services are active remains and battery life would suggest that the service is using power.
At the moment the only way to reduce to stop the power usage is to terminate the program - but many user would not know how to do that or that they need to and I suspect Apple will reject the app on those grounds.
Any suggestions would be appreciated.