cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-10278) geolocation watchPosition doesn't return watchID string
Date Wed, 30 Dec 2015 11:53:49 GMT

    [ https://issues.apache.org/jira/browse/CB-10278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15074969#comment-15074969
] 

ASF GitHub Bot commented on CB-10278:
-------------------------------------

Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-geolocation/pull/63#discussion_r48600376
  
    --- Diff: www/android/geolocation.js ---
    @@ -38,21 +39,29 @@ module.exports = {
         },
     
         watchPosition: function(success, error, args) {
    +        var pluginWatchId = utils.createUUID();
    +
             var win = function() {
                 var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window,
'navigator.geolocation');
    -            geo.watchPosition(success, error, {
    +            pluginToNativeWatchMap[pluginWatchId] = geo.watchPosition(success, error,
{
                     enableHighAccuracy: args[1]
                 });
             };
             exec(win, error, "Geolocation", "getPermission", []);
    +
    +        return pluginWatchId;
         },
     
    -    clearWatch: function(success, error, args) {
    +    clearWatch: function(pluginWatchId) {
             var win = function() {
    -          var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window,
'navigator.geolocation');
    -          geo.clearWatch(args[0]);
    +            var nativeWatchId = pluginToNativeWatchMap[pluginWatchId];
    --- End diff --
    
    I tested this case and incorrect value (which does not exist or undefined) was ignored
w/o any error or exception


> geolocation watchPosition doesn't return watchID string
> -------------------------------------------------------
>
>                 Key: CB-10278
>                 URL: https://issues.apache.org/jira/browse/CB-10278
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin Geolocation
>         Environment: Android 4.4 on samsung galaxy s5.
> Android 5.0 on samsung galaxy s5.
>            Reporter: Nicholas Tsaoucis
>              Labels: Android, Triaged
>
> With the new version of the geolocation plugin (-r1.0.1- 2.0.0) when calling watchPosition
no watchID is returned as a string. only undefined is returned.
> This makes it impossible to call clearWatch as we don't have the watchID to use in the
clearWatch call.
> I rolled back to version -r1.0.0- r1.0.1 and it works properly.
> ~edit
> The issue is actually with the master branch (version 2.0.0)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message