cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gianfranco Palumbo (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-13385) Geolocation doesn't work on Android 8.0 (Oreo)
Date Tue, 03 Oct 2017 20:15:01 GMT

     [ https://issues.apache.org/jira/browse/CB-13385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gianfranco Palumbo updated CB-13385:
------------------------------------
    Description: 
With a Google LG Nexus 5X and I can't manage to make {{getCurrentPosition()}} work.

I have Wi-Fi on, Location on high accuracy, Mobile data on, even Bluetooth on, but nothing.

You can replicate by running this code in the Chrome Dev console (via Remote devices):
{code:javascript}
  var geoOptions = {
     timeout: 10 * 1000
  }

  var geoSuccess = function(position) {
    alert('Success! Lat: ' + position.coords.latitude + '  . Long: ' + position.coords.longitude);
  };
  var geoError = function(error) {
    alert('Error occurred. Error code: ' + error.code);
    // error.code can be:
    //   0: unknown error
    //   1: permission denied
    //   2: position unavailable (error response from location provider)
    //   3: timed out
  };

  navigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions);
{code}

I also managed to reproduce with a cordova plugin and ionic native showcase app:
# https://play.google.com/store/apps/details?id=br.com.marcioggs.cordovashowcase&rdid=br.com.marcioggs.cordovashowcase
# https://play.google.com/store/apps/details?id=com.ionichelper.ionic2native&rdid=com.ionichelper.ionic2native
(though no error appears)

Code the 1st app is here: https://github.com/michaelrbk/showCaseCordova/blob/master/www/js/geolocation.js

Trying a phone with Android 6 is fine.

Could this be related to this?
https://developer.android.com/about/versions/oreo/background-location-limits.html

  was:
With a Google LG Nexus 5X and I can't manage to make {{getCurrentPosition()}} work.

I have Wi-Fi on, Location on high accuracy, Mobile data on, even Bluetooth on, but nothing.

You can replicate by running this code in the Chrome Dev console (via Remote devices):
{code:javascript}
  var geoOptions = {
     timeout: 10 * 1000
  }

  var geoSuccess = function(position) {
    alert('Success! Lat: ' + position.coords.latitude + '  . Long: ' + position.coords.longitude);
  };
  var geoError = function(error) {
    alert('Error occurred. Error code: ' + error.code);
    // error.code can be:
    //   0: unknown error
    //   1: permission denied
    //   2: position unavailable (error response from location provider)
    //   3: timed out
  };

  navigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions);
{code}

I also managed to reproduce with a cordova plugin and ionic native showcase app:
https://play.google.com/store/apps/details?id=br.com.marcioggs.cordovashowcase&rdid=br.com.marcioggs.cordovashowcase
https://play.google.com/store/apps/details?id=com.ionichelper.ionic2native&rdid=com.ionichelper.ionic2native
(though no error appears on the 2nd app)

Trying a phone with Android 6 is fine.

Could this be related to this?
https://developer.android.com/about/versions/oreo/background-location-limits.html


> Geolocation doesn't work on Android 8.0 (Oreo)
> ----------------------------------------------
>
>                 Key: CB-13385
>                 URL: https://issues.apache.org/jira/browse/CB-13385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-geolocation
>            Reporter: Gianfranco Palumbo
>              Labels: android8.0
>
> With a Google LG Nexus 5X and I can't manage to make {{getCurrentPosition()}} work.
> I have Wi-Fi on, Location on high accuracy, Mobile data on, even Bluetooth on, but nothing.
> You can replicate by running this code in the Chrome Dev console (via Remote devices):
> {code:javascript}
>   var geoOptions = {
>      timeout: 10 * 1000
>   }
>   var geoSuccess = function(position) {
>     alert('Success! Lat: ' + position.coords.latitude + '  . Long: ' + position.coords.longitude);
>   };
>   var geoError = function(error) {
>     alert('Error occurred. Error code: ' + error.code);
>     // error.code can be:
>     //   0: unknown error
>     //   1: permission denied
>     //   2: position unavailable (error response from location provider)
>     //   3: timed out
>   };
>   navigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions);
> {code}
> I also managed to reproduce with a cordova plugin and ionic native showcase app:
> # https://play.google.com/store/apps/details?id=br.com.marcioggs.cordovashowcase&rdid=br.com.marcioggs.cordovashowcase
> # https://play.google.com/store/apps/details?id=com.ionichelper.ionic2native&rdid=com.ionichelper.ionic2native
> (though no error appears)
> Code the 1st app is here: https://github.com/michaelrbk/showCaseCordova/blob/master/www/js/geolocation.js
> Trying a phone with Android 6 is fine.
> Could this be related to this?
> https://developer.android.com/about/versions/oreo/background-location-limits.html



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message