Hi,
I have started implementing ionic GeoLocation native according to the instructions provided on the ionic site.
Please see below for my code:
this.platform.ready().then(() => {
console.log('GEO SERVICE initializeGeoService()');
let watchPosition = this.geoLocation.watchPosition();
watchPosition.subscribe((locationData) => {
console.log('WATCH Lat -> ' + locationData.coords.latitude);
console.log('WATCH Lan -> ' + locationData.coords.longitude);
console.log('TIMESTAMP -> ' + locationData.timestamp);
this.writeGeoDataForUser(locationData.coords.latitude, locationData.coords.longitude,
locationData.timestamp);
});
});
This seems to be working when I run the app in the Chrome browser. However, when I make an iOS build and run it on an iOS device, I keep getting the following error:
[956:260097] Error: TypeError: undefined is not an object (evaluating ‘locationData.coords.latitude’)**
[956:260097] ERROR: ERROR TypeError: undefined is not an object (evaluating ‘locationData.coords.latitude’)**
Does anyone have experience on how to get this working on iOS? Or has encountered the similar error and was able to resolve it? Thanks in advance.