Issue
I am using @ionic-native/geolocation to track the user's position.
startTracking() {
console.log("startTracking");
this.positionSubscription = this.geolocation.watchPosition()
.subscribe(data => {
console.log("subscription");
console.log(data.coords.latitude);
console.log(data.coords.longitude);
});
}
But when I change the position, nothing happened. What's wrong? I am trying on android emulator.
Solution
I found solution. I used cordova-plugin-geolocation. But it is not working well on android. It shows error 'getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS.' After spending much time to resolve this issue, I finally got answer. Don't use this plugin. Instead use this plugin. @mauron85/cordova-plugin-background-geolocation This plugin is working well. Hope this helps somebody who has same problem with me.
Answered By - Blake
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.