where can i found a geoloc sample code…
can’t make it run
androidmanifest.xml
android:targetSdkVersion=“26”
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.hardware.location.gps
app.module
import { Geolocation } from ‘@ionic-native/geolocation’;
home.ts
ionViewDidLoad(){
this.getPosition();
}
getPosition() {
this.geolocation.getCurrentPosition({timeout:5000}).then((resp) => {
// resp.coords.latitude
// resp.coords.longitude
console.log(resp);
this.coords = resp ;
}).catch((error) => {
console.log(‘Error getting location’, error);
});
}
=> Time out