I searched various forums and posts related to GeoLocation based alert issue; For some reason no technique worked in my case.
Added "cordova-plugin-geolocation" plugin to my Ionic Framework Project.
Added to my base Controller under $ionicPlatform.ready(...)
navigator.geolocation.getCurrentPosition(function(position) {
var coords = {};
coords.updated = new Date();
coords.latitude = position.coords.latitude.toFixed(6);
coords.longitude = position.coords.longitude.toFixed(6);
coords.altitude = position.coords.altitude + ' m';
coords.accuracy = position.coords.accuracy + ' m';
coords.altitudeAccuracy = position.coords.altitudeAccuracy + ' m';
coords.heading = position.coords.heading + '\u00b0';
coords.speed = position.coords.speed + ' m/s';
console.log('Fetched Location...' + geoText);
return position;
}, function(err) {
Logger.error(err.message);
}, {
timeout: 10000,
enableHighAccuracy: true
});
When I emulate / run in iOS / Android it throws
Error Message: /www/index.html would like to use Your Location
I would greatly appreciate if someone can help.