ArcGIS Runtime SDK for iOS
100.15
|
A condition monitored by an AGSGeotriggerMonitor
.
An AGSGeotrigger
defines a condition that can be continually monitored in real time. After the condition is met, the AGSGeotrigger
defines how an AGSGeotriggerNotificationInfo
can be used to inform the user.
An AGSGeotriggerMonitor
, created with the AGSGeotrigger
, handles monitoring and reporting.
You can create an AGSFenceGeotrigger
describing target areas, covered by spatial rules such as enter or exit. This type of spatial monitoring is also known as "Geofencing".
If an AGSGeotrigger
is defined in an AGSGeotriggersInfo
, check whether the AGSGeotriggerFeed
is of type AGSLocationGeotriggerFeed
and, if so, supply an AGSLocationDataSource
to provide your device location. Set the AGSLocationGeotriggerFeed::locationDataSource
to your AGSLocationDataSource
. For example, using the AGSLocationDisplay::dataSource
.
Properties | |
AGSGeotriggerFeed * | feed |
NSString * | geotriggerID |
AGSArcadeExpression * | messageExpression |
NSString * | name |
NSArray< NSString * > * | requestedActions |
|
readnonatomicstrong |
The AGSGeotriggerFeed
that is monitored for changes.
You can construct an AGSLocationGeotriggerFeed
from any AGSLocationDataSource
. Typically, this shows the device location based on GPS, but can be any AGSLocationDataSource
.
|
readnonatomiccopy |
A unique ID for the AGSGeotrigger
.
|
readwritenonatomicstrong |
An AGSArcadeExpression
that controls the notification details when an AGSGeotrigger
is met.
The expression uses the Arcade language to generate notification information that can be:
AGSGeotrigger
AGSGeotrigger
The expression is evaluated whenever the AGSGeotrigger
condition is met, in order to populate the AGSGeotriggerNotificationInfo::message
property. Display this message to alert the user that the AGSGeotrigger
condition has been met. Note that the expression cannot be changed when the AGSGeotriggerMonitor
is running.
For example, with an AGSFenceGeotrigger
, using the following expression:
"You have " + $fencenotificationtype + " " + $fencefeature.area_name
returns the AGSGeotriggerNotificationInfo::message
"You have entered Area A", where "area_name" is an attribute field on the AGSFenceGeotriggerNotificationInfo::fenceGeoElement
.
Optionally, the expression can return extra properties in addition to the message. For example, it could produce another string, suitable for logging to a database. To supply additional properties, write an arcade expression that evaluates to a dictionary of key value pairs.
AGSGeotriggerNotificationInfo::message
property.AGSGeotriggerNotificationInfo::actions
property.AGSGeotriggerNotificationInfo::messageProperties
dictionary.For example, the following expression results in an AGSGeotriggerNotificationInfo::message
of: "Hello world" and an AGSGeotriggerNotificationInfo::actions
list of either "startTracking" or "stopTracking":
The AGSArcadeExpression
must evaluate to either a string or a dictionary; see AGSArcadeExpression::returnType
. Note that this property is an AGSArcadeExpression
object, rather than a string.
The AGSArcadeExpression
must evaluate to either a string or a dictionary - see AGSArcadeExpression::returnType
.
For more information on the available profile variables and functions for creating the AGSGeotrigger::messageExpression
, see the "Geotrigger Notification" profile at https://developers.arcgis.com/arcade/guide/profiles/.
|
readwritenonatomiccopy |
The name of the AGSGeotrigger
.
|
readwritenonatomiccopy |
An array of strings indicating the set of requested actions when a notification is delivered.
This property provides the full list of recommended actions that the AGSGeotrigger
author intends to be taken. Note that there is no requirement to take any action when a notification is delivered, but these provide a way to understand the AGSGeotrigger
author's intention. Use this property to:
AGSGeotrigger
to the user, prior to monitoring. AGSGeotrigger
.This list of strings is the full set of recommended actions for any notifications from this AGSGeotrigger
. Individual AGSGeotriggerNotificationInfo
events may include a subset of these actions. The specific actions for an individual notification event (for example, when a given fence is entered) are shown in AGSGeotriggerNotificationInfo::actions
. To populate the array of actions for a notification, the AGSGeotrigger::messageExpression
property must return a dictionary with the key "actions", and an array of action strings as the value.
The actions are simple strings, so you can use them to control any custom action you wish your app to perform.