You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Shazron <sh...@gmail.com> on 2012/04/14 00:27:36 UTC

stopping GPS after clearWatch

re: https://issues.apache.org/jira/browse/CB-509

How do you guys handle this under other platforms?

Right now there's no way to stop the location on iOS since with the
start of cordova-js the stop function was taken out. We really need
this functionality in iOS (stop). Right now clearWatch is all
javascript, but it clearly needs to signal to native to stop the GPS.

Re: stopping GPS after clearWatch

Posted by Filip Maj <fi...@adobe.com>.
Ya 1.7.

Sorry forgot the link in last mail:
https://github.com/filmaj/incubator-cordova-ios/tree/geoupdate

On 4/13/12 8:11 PM, "Shazron" <sh...@gmail.com> wrote:

>Sounds swell, 1.7.0 target right? I made a quick plugin for the
>existing devs that really really need to save battery in the interim.
>
>On Fri, Apr 13, 2012 at 7:12 PM, Filip Maj <fi...@adobe.com> wrote:
>> Yeh here's the native change on iOS.
>>
>> Essentially whenever a getCurrent or watch call comes into native, we
>> store the callback id. We check if that's the first request, if so,
>>native
>> will call a private "start" method.
>>
>> Then whenever we get a native geo update, we sent the data back to web
>> view, clear all getCurrent callback ids, and if we have no more stored
>> callback ids, we call private "stop" method.
>>
>> I've got android lined up with that exact impl. as well.
>>
>> On 4/13/12 5:59 PM, "Becky Gibson" <gi...@gmail.com> wrote:
>>
>>>Fil has a branch that rewrites location.  I think that will address
>>>this.
>>>
>>>-Becky
>>>
>>>Sent from my iPad
>>>
>>>On Apr 13, 2012, at 6:27 PM, Shazron <sh...@gmail.com> wrote:
>>>
>>>> re: https://issues.apache.org/jira/browse/CB-509
>>>>
>>>> How do you guys handle this under other platforms?
>>>>
>>>> Right now there's no way to stop the location on iOS since with the
>>>> start of cordova-js the stop function was taken out. We really need
>>>> this functionality in iOS (stop). Right now clearWatch is all
>>>> javascript, but it clearly needs to signal to native to stop the GPS.
>>


Re: stopping GPS after clearWatch

Posted by Shazron <sh...@gmail.com>.
Sounds swell, 1.7.0 target right? I made a quick plugin for the
existing devs that really really need to save battery in the interim.

On Fri, Apr 13, 2012 at 7:12 PM, Filip Maj <fi...@adobe.com> wrote:
> Yeh here's the native change on iOS.
>
> Essentially whenever a getCurrent or watch call comes into native, we
> store the callback id. We check if that's the first request, if so, native
> will call a private "start" method.
>
> Then whenever we get a native geo update, we sent the data back to web
> view, clear all getCurrent callback ids, and if we have no more stored
> callback ids, we call private "stop" method.
>
> I've got android lined up with that exact impl. as well.
>
> On 4/13/12 5:59 PM, "Becky Gibson" <gi...@gmail.com> wrote:
>
>>Fil has a branch that rewrites location.  I think that will address this.
>>
>>-Becky
>>
>>Sent from my iPad
>>
>>On Apr 13, 2012, at 6:27 PM, Shazron <sh...@gmail.com> wrote:
>>
>>> re: https://issues.apache.org/jira/browse/CB-509
>>>
>>> How do you guys handle this under other platforms?
>>>
>>> Right now there's no way to stop the location on iOS since with the
>>> start of cordova-js the stop function was taken out. We really need
>>> this functionality in iOS (stop). Right now clearWatch is all
>>> javascript, but it clearly needs to signal to native to stop the GPS.
>

Re: stopping GPS after clearWatch

Posted by Filip Maj <fi...@adobe.com>.
Yeh here's the native change on iOS.

Essentially whenever a getCurrent or watch call comes into native, we
store the callback id. We check if that's the first request, if so, native
will call a private "start" method.

Then whenever we get a native geo update, we sent the data back to web
view, clear all getCurrent callback ids, and if we have no more stored
callback ids, we call private "stop" method.

I've got android lined up with that exact impl. as well.

On 4/13/12 5:59 PM, "Becky Gibson" <gi...@gmail.com> wrote:

>Fil has a branch that rewrites location.  I think that will address this.
>
>-Becky
>
>Sent from my iPad
>
>On Apr 13, 2012, at 6:27 PM, Shazron <sh...@gmail.com> wrote:
>
>> re: https://issues.apache.org/jira/browse/CB-509
>> 
>> How do you guys handle this under other platforms?
>> 
>> Right now there's no way to stop the location on iOS since with the
>> start of cordova-js the stop function was taken out. We really need
>> this functionality in iOS (stop). Right now clearWatch is all
>> javascript, but it clearly needs to signal to native to stop the GPS.


Re: stopping GPS after clearWatch

Posted by Becky Gibson <gi...@gmail.com>.
Fil has a branch that rewrites location.  I think that will address this.

-Becky

Sent from my iPad

On Apr 13, 2012, at 6:27 PM, Shazron <sh...@gmail.com> wrote:

> re: https://issues.apache.org/jira/browse/CB-509
> 
> How do you guys handle this under other platforms?
> 
> Right now there's no way to stop the location on iOS since with the
> start of cordova-js the stop function was taken out. We really need
> this functionality in iOS (stop). Right now clearWatch is all
> javascript, but it clearly needs to signal to native to stop the GPS.