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 successCallback
function callback to be executed when successful added the specified geofence errorCallback
function callback to be executed when there was an error params
Object objects that must have the following properties: Properties
Name Type Description fid
String the fence identifier a string to identify this fence later latitude
String the latitude of the fence longitude
String the longitude of the fence radius
String 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 successCallback
function called with the list of watched fences errorCallback
function 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.callback
function <optional>
callback to be executed if a geofencing is entered or left params.notifyMessage
String <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 fid
String the fence identifier of the fence to remove - Source:
Returns:
- Type
- void