ArcGIS Runtime SDK for iOS: AGSGeotriggerMonitor Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSGeotriggerMonitor Class Reference


An AGSGeotriggerMonitor monitors an AGSGeotrigger condition and, when it is met, results in an AGSGeotriggerNotificationInfo.

An AGSGeotrigger defines a query that is evaluated against GIS data as it changes in real time. For example, "Notify me when my device location enters one of my target areas" or "Notify me when my device location is within 50 m of my destination".

An AGSGeotriggerMonitor is created with an AGSGeotrigger that it continually checks to determine whether the condition has been met.

Once an AGSGeotriggerMonitor is created, you begin checking the condition by calling startWithCompletion: (AGSGeotriggerMonitor). Once you are finished, call stop (AGSGeotriggerMonitor). When an AGSGeotrigger evaluates to YES, an AGSGeotriggerMonitorDidTriggerNotification is sent via the default notification center.

To receive details of where the AGSGeotrigger was activated and the condition that was met, add an observer to the default notification center (NSNotificationCenter). The userInfo dictionary of the posted notification info will contain an AGSGeotriggerNotificationInfo object with key: AGSGeotriggerNotificationInfoKey that has the notification details.

Inheritance diagram for AGSGeotriggerMonitor:

Instance Methods

(instancetype) - initWithGeotrigger:
(id< AGSCancelable >) - startWithCompletion:
(void) - stop

Class Methods

(instancetype) + geotriggerMonitorWithGeotrigger:


AGSGeotriggerMonitorStatus status
NSError * warning

Method Documentation

◆ geotriggerMonitorWithGeotrigger:

+ (instancetype) geotriggerMonitorWithGeotrigger: (AGSGeotrigger *)  geotrigger

Instantiates an AGSGeotriggerMonitor with an AGSGeotrigger condition.

geotriggerThe AGSGeotrigger which will be monitored.

◆ initWithGeotrigger:

- (instancetype) initWithGeotrigger: (AGSGeotrigger *)  geotrigger

Instantiates an AGSGeotriggerMonitor with an AGSGeotrigger condition.

geotriggerThe AGSGeotrigger which will be monitored.

◆ startWithCompletion:

- (id<AGSCancelable>) startWithCompletion: (nullable void(^)(NSError *_Nullable error))  completion

Starts evaluating the AGSGeotriggerMonitor.

When the AGSGeotriggerMonitor is successfully performing checks, the AGSGeotriggerMonitor::status will be AGSGeotriggerMonitorStatusStarted.

completionThe error parameter is populated on failure.
An operation which can be canceled.

◆ stop

- (void) stop

Stops evaluating the AGSGeotriggerMonitor.

Stopping the AGSGeotriggerMonitor prevents the condition from being evaluated and notifications from being sent. If you are using an AGSLocationGeotriggerFeed created from an AGSLocationDataSource, the data source must also be stopped to turn off GPS receivers etc.

When the AGSGeotriggerMonitor is stopped, the AGSGeotriggerMonitor::status will be AGSGeotriggerMonitorStatusStopped.


Property Documentation

◆ geotrigger

- (AGSGeotrigger*) geotrigger

The AGSGeotrigger that will be monitored.


◆ status

- (AGSGeotriggerMonitorStatus) status

The current monitoring status of the AGSGeotriggerMonitor.

An AGSGeotriggerMonitor begins with a monitoring status of AGSGeotriggerMonitorStatusStopped and changes to AGSGeotriggerMonitorStatusStarted when you call AGSGeotriggerMonitor::startWithCompletion. When you call stop, the monitoring status changes to AGSGeotriggerMonitorStatusStopped.


◆ warning

- (NSError*) warning

An error that describes a problem encountered while starting or monitoring the AGSGeotrigger.

A warning can occur at various stages of monitoring an AGSGeotrigger:

If the problem is resolved, this property will be cleared.

Problems that occur when starting the AGSGeotriggerMonitor result in an AGSGeotriggerMonitor::status of AGSGeotriggerMonitorStatusFailedToStart. These issues must be fixed and start called again before you receive any notifications. For example, if the AGSGeotrigger::messageExpression is an invalid AGSArcadeExpression, monitoring cannot be carried out.

Problems that occur when accessing the components of the AGSGeotrigger will not prevent the AGSGeotriggerMonitor from starting. However, until the problem is resolved, you will not receive any notifications. For example, if an AGSLocationGeotriggerFeed uses an AGSLocationDataSource that is not started, you will not receive any notifications. Once the AGSLocationDataSource is successfully started, monitoring will resume. If an AGSFenceParameters has no valid data for a fence you will not receive any notifications.

Problems that occur during ongoing monitoring relate to issues with individual objects such as the graphics that make up the fences for an AGSGraphicFenceParameters. These warnings do not prevent notifications from being sent for other valid fences. For example, a fence is considered invalid if it has: