I'm using navigator.geolocation.getCurrentPosition
to get the location with position.coords.latitude
and position.coords.longitude
, the function that calculates this is used in an android app through a webview.
The problem is when I test this function in a browser it gives me the correct location and when I test it in android app it's giving to me another location (I think it's default location or older location of the device).
My gradle is this one:
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}