Hi there, still struggling with Android geolocation and the problem seems to be more serious than I thought because it comes up with the standard example.
I start from the empty blank project, add the cordova geolocation plugin, add few lines of code. Yet it fails with a timeout on a physical Android phone (6.0). Can it really be that the plugin is not supported for Droid > 5.1 as stated on the repo page?
ionic start geoTest blank --v2
ionic platform add android
ionic plugin add cordova-plugin-geolocation
open ./src/app/app.component.ts
Adding :
import { StatusBar, Splashscreen,Geolocation } from 'ionic-native';
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
Splashscreen.hide();
Geolocation.getCurrentPosition({ maximumAge: 60000, timeout: 30000, enableHighAccuracy: true }).then((position) => {
console.log(position);
}, (error) => {
console.log(error);
});
});
Keeps giving me timeouts / error 3.
Android manifest file contains
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.hardware.location.gps