Skip to content

Instantly share code, notes, and snippets.

@nicobytes
Created November 1, 2017 13:34
Show Gist options
  • Save nicobytes/3f5574ca1fce6f489f7ec610aade42f0 to your computer and use it in GitHub Desktop.
Save nicobytes/3f5574ca1fce6f489f7ec610aade42f0 to your computer and use it in GitHub Desktop.
watchPosition
import { Geolocation } from '@ionic-native/geolocation';
...
constructor(private geolocation: Geolocation) {}
...
let watch = this.geolocation.watchPosition();
watch.subscribe((data) => {
// data can be a set of coordinates, or an error (if an error occurred).
// data.coords.latitude
// data.coords.longitude
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment