The Geolocation API follows the web spec: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation
You need to include the
NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation. Geolocation is enabled by default when you create a project with
To request access to location, you need to add the following line to your app's
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
static getCurrentPosition(geo_success, geo_error?, geo_options?)
Invokes the success callback once with the latest location info. Supported options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool) On Android, this can return almost immediately if the location is cached or request an update, which might take a while.
static watchPosition(success, error?, options?)
Invokes the success callback whenever the location changes. Supported options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool), distanceFilter(m)
Stops observing for device location changes. In addition, it removes all listeners previously registered.
Notice that this method has only effect if the
geolocation.watchPosition(successCallback, errorCallback) method was previously invoked.