Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F4072186DF for ; Wed, 30 Dec 2015 11:53:49 +0000 (UTC) Received: (qmail 58826 invoked by uid 500); 30 Dec 2015 11:53:49 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 58791 invoked by uid 500); 30 Dec 2015 11:53:49 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 58767 invoked by uid 99); 30 Dec 2015 11:53:49 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2015 11:53:49 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 945A12C1F54 for ; Wed, 30 Dec 2015 11:53:49 +0000 (UTC) Date: Wed, 30 Dec 2015 11:53:49 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-10278) geolocation watchPosition doesn't return watchID string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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