geoLocation.getCurrentPosition not working

Not sure what is going on, but some users are saying they can’t get our map functionality to work. We have a popup tell them to turn on gps and they said everything is on.

It seems like sometime during the development of our app we started to notice our old Samsung S5 having this issue. You would approve gps access, but getCurrentPostion just times out. We would do a popup telling the user to turn on gps in the settings. Then retry.
The only thing I could get working in testing was turning off wifi. GPS would be found, and could turn wifi back on. (Did not have any problems with a S7 or Pixel 2 phone)

We have just released our app, and we have gotten two bad reviews on the android play store saying that gps isn’t working, they keep getting the popup.

In our config.xml it has this version

Is there a way to download an older version. Not sure where to find a list of versions?
I know a year ago with just a cordova app we had version 2.4.3 which as far as I remember worked fine.
Might try that version.

If you have solution for it and send me i am also facing to fetch current location details using this plugin in ionic4. i need to fetch current longitude and latitude for the current location but its not working on android device but its working on browser only.
If you got solution for it then please help me…

Thanks

We never had this issue on all android devices samsung devices seem to be buggy. (S5 and S7).

What we did.
Set the timeout to 20 seconds. Probably not needed on the web gps lookup (highAccuracy false)
Start with the enableHighAccuracy as false.

What we do is try to pull the location based of the network. highAccuaracy is turned off.
This seems to work find on iphone, other android phones (pixel 2).

After we fail the first time, we do a popup making sure their location settings are turned on.
We change highAccuaracy to true now its going to try to use the actually GPS chip. This does seem to take longer and thus the need for higher timeout.

We try again.
From our testing on the samsung phone, we fail the first time, but once use GPS we get a location.

I have tried above all solutions but still its not working my ionic info as below:

Ionic:

ionic (Ionic CLI) : 4.0.6 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.11

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0

System:

NodeJS : v8.11.2 (C:\Program Files\nodejs\node.exe)
npm : 6.1.0
OS : Windows 10

Environment:

ANDROID_HOME : F:\Android\android-sdk\tools;F:\Android\android-sdk\platform-tools

I am using below code:
ionViewDidLoad() {
console.log(‘ionViewDidLoad ViewleadPage’);
this.getLocation();
}

getLocation(){
let options = {timeout: 5000, enableHighAccuracy: false};
this.geolocation.getCurrentPosition(options).then((resp) => {
this.lat = resp.coords.latitude;
this.lang = resp.coords.longitude;
alert(this.lat);
console.log(‘getting location’, this.lat);
}).catch((error) => {
console.log(‘Error getting location’, error);
});
}

Like I said, change your timeout to something higher like 20000, have you tried turning High Accuracy to true to see what results you get.

What phones have you tried it on?

I am using MI mobile, Samsung, Honor tab as well as I am testing on the ionicDev app. I have try all possible ways.
Sometimes it shows me longitude and latitude details on HONOR tab while using the application but on MI, Samsung and Vivo not showing.

Its too big issue with the IONIC + Cordova

bro are you fix above issue i am also facing same error as well as i have nor recived success callback nor received error callback why?

Hello, how to get the location device A from device B ?