On Friday, November 6, 2015 at 12:06:39 PM UTC+8, [email protected] wrote: > On Friday, November 6, 2015 at 11:51:42 AM UTC+8, Douglas Turner wrote: > > We don't want to add more options to the geolocation API. > > > > I do agree with Jonas -- we can stop sending events to backgrounded > > applications if we add a wake lock (?) for geolocation? A side effect of > > this could be to have system UI that shows that geo is being used in the > > background. > > > > Thoughts? > > > > > > > > On Thu, Nov 5, 2015 at 7:44 PM Shawn Huang <[email protected]> wrote: > > > > > On behave of Ya-Chieh Wu <[email protected]> > > > > > > Bugzilla: > > > https://bugzilla.mozilla.org/show_bug.cgi?id=1216148 > > > > > > Symptom: > > > There is no specific way to indicate if an application wants to use GPS in > > > the background. Currently, we don't stop GPS when application goes to > > > background which might result in increase in battery use. On Android and > > > iOS, getting GPS in the background is not a default behavior. > > > > > > > > > Summarize the solutions which we brought up here or in Bugzilla before: > > > > > > (1)add a geolocation choice in wakeLock [1] > > > > > > window.navigator.requestWakeLock(type) > > > var lock = window.navigator.requestWakeLock('screen'); > > > lock.unlock(); > > > > > > > > > (2)add a property in PositionOptions [2] > > > runInBackground = true, //default is false > > > > > > > > > id = navigator.geolocation.watchPosition(success, error, options); > > > options = { > > > enableHighAccuracy: false, //default: false > > > timeout: 5000, //default: Infinity > > > maximumAge: 0 //default: Infinity > > > }; > > > > > > [1] > > > > > > https://groups.google.com/forum/#!searchin/mozilla.dev.geolocation/Backgrounded$20apps$20using$20GPS$20|sort:relevance/mozilla.dev.geolocation/UXkd3Tz1GPc/BtqtJ81Wi2YJ > > > > > > [2]https://bugzilla.mozilla.org/show_bug.cgi?id=1216148#c6 > > > > > > > > > > > > any other suggestion to contribute this API ? > > > > > > > > > > > > > > > > > > -- > > > Regards, > > > Shawn Huang > > > _______________________________________________ > > > dev-geolocation mailing list > > > [email protected] > > > https://lists.mozilla.org/listinfo/dev-geolocation > > > > > In my opinion, using wakelock is not so intuitive for application developer. > Like the wakelock page indicates, "the risk of claiming the lock is that > users may forget to close the app when they are done using it". Developers > need to lock the service and unlock this service carefully by themselves > which sometimes might cause serious results. > > And Let's look at the cases on Android and IOS, they are also using the way > like the second suggestion which is telling the system that they want their > service runs in background and let service handle by the system without > needing to worry about it.
by the way, we also tried to implement (2) to solve this and it seems that it works well. _______________________________________________ dev-geolocation mailing list [email protected] https://lists.mozilla.org/listinfo/dev-geolocation
