new geofencing() → {object}
the global geofencing object is the entry point for all geofencing methods
- Source:
Returns:
geofencing - The geofencing api
- Type
- object
Methods
-
<static> addRegion(successCallback, errorCallback, params) → {void}
-
Add a geofence for a specific region. The fenceId (fid) needs to be a unique string, because this is passed when the notification callback is called.
Parameters:
Name Type Description successCallbackfunction callback to be executed when successful added the specified geofence errorCallbackfunction callback to be executed when there was an error paramsObject objects that must have the following properties: Properties
Name Type Description fidString the fence identifier a string to identify this fence later latitudeString the latitude of the fence longitudeString the longitude of the fence radiusString the radius of the fence - Source:
Returns:
- Type
- void
-
<static> getWatchedRegionIds(successCallback, errorCallback) → {void}
-
SuccessCallback will get called with all the fenceIds that are currently being watched/monitored
Parameters:
Name Type Description successCallbackfunction called with the list of watched fences errorCallbackfunction called if there was an error fetching the fences - Source:
Returns:
- Type
- void
-
<static> register() → {void}
-
register a callback to get called when the geofence is entered or left ( a geofence is a radius around a geo coordinate ) use addRegion to add a geofence.
Parameters:
Name Type Argument Description params.callbackfunction <optional>
callback to be executed if a geofencing is entered or left params.notifyMessageString <optional>
Message to be used for the alert defaults to 'You have {left/entered} your point of interest' - Source:
Returns:
- Type
- void
-
<static> removeRegion(fid) → {void}
-
Remove a watched region for entering and leaving events by it's unique fenceId
Parameters:
Name Type Description fidString the fence identifier of the fence to remove - Source:
Returns:
- Type
- void