cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Grebnov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-8443) Android: nothing happens if GPS is turned off
Date Tue, 05 Jan 2016 13:15:39 GMT

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

Sergey Grebnov commented on CB-8443:
------------------------------------

I recommend adding some timeout and handling onError callback, something like this
{code}

function onSuccess (position) {
//.. do something
};

function onError(error) {
    if (error.code == error.TIMEOUT) {
        alert('Unable to retrive current location. Please make sure GPS service is turned
on');
    } else { // another error
       // ...
    }
}

// use 30s timeout
navigator.geolocation.getCurrentPosition(onSuccess, onError, {timeout: 30000 });
{code}

> Android: nothing happens if GPS is turned off
> ---------------------------------------------
>
>                 Key: CB-8443
>                 URL: https://issues.apache.org/jira/browse/CB-8443
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Geolocation
>    Affects Versions: 3.5.0
>         Environment: moto G android 4.4.4
>            Reporter: clement bidon
>            Assignee: Sergey Grebnov
>              Labels: android, triaged
>
> to goe the error:  disable "ALL LOCATION SERVICE" on the phone.
> call "getCurrentPosition" or "watchPosition" functions without any timout.
> The "onError" function should be called with "PositionError.PERMISSION_DENIED" or with
"PositionError.POSITION_UNAVAILABLE", BUT IT S NOT THE CASE: --> nothing happens.



--
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