Provides methods for accessing ArrowDB geo-fence objects.
This feature is only available for enterprise users, and the current user must be an application admin to create, update or remove geo-fence objects.
The ArrowDB GeoFences API lets you manage geographic regions with an associated JSON data payload. Use this API to have the device query the ArrowDB server to retrieve data based on a location.
This example creates a new geo-fence object covering a 10 mile radius around San Francisco, CA, USA, and checks the response.
Cloud.GeoFences.create({
geo_fence: {
"loc":{"coordinates":[-122.4167,37.7833], "radius":"10/3959"},
"payload":{"alert":"24-hour sale at our SF flagship store on 12/26!"},
"start_time": "2014-12-25T00:00",
"end_time":"2014-12-26T19:00"
}
}, function (e) {
if (e.success) {
Ti.API.info(JSON.stringify(e.geo_fences));
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example searches for geo-fence objects within 2 km of Oakland, CA, USA, and checks the response.
Cloud.GeoFences.query({
where:{
"loc": {
"$nearSphere" : {
"$geometry" : { "type" : "Point", "coordinates" : [-122.2708,37.8044] },
"$maxDistance" : 2000
}
}
}
}, function (e) {
if (e.success) {
Ti.API.info(JSON.stringify(e.geo_fences));
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example updates a geo-fence object and checks the response.
Cloud.GeoFences.update({
id: geoFenceId,
geo_fence:{"loc":{"place_id":"531a1217447d300f05003b69","radius":"2/6371"}}
}, function (e) {
if (e.success) {
Ti.API.info(JSON.stringify(e.geo_fences));
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example deletes a geo-fence object and checks the response.
Cloud.GeoFences.remove({
id: geoFenceId
}, function (e) {
if (e.success) {
Ti.API.info(JSON.stringify(e));
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
The name of the API that this proxy corresponds to.
The name of the API that this proxy corresponds to.
The value of this property is the fully qualified name of the API. For example, Button
returns Ti.UI.Button
.
Indicates if the proxy will bubble an event to its parent.
Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.
Default: true
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.
Applies the properties to the proxy.
Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.
A dictionary of properties to apply.
Create a new geofence object.
You must be an enterprise application admin to use this API.
See geo_fences/create.json for the request parameters supported by this method.
Data is returned in the geo_fences
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Retrieve a list of places with sorting and pagination.
You must be an enterprise application user to use this API.
See geo_fences/query.json for the request parameters supported by this method.
Data is returned in the geo_fences
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Delete a place.
You must be an enterprise application admin to use this API.
See geo_fences/delete.json for the request parameters supported by this method.
Parameters to send in the request.
Callback function to execute when the method completes.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.
Update information about a place.
You must be an enterprise application admin to use this API.
See geo_fences/update.json for the request parameters supported by this method.
Data is returned in the geo_fences
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.