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

Description

Feed data for an AGSGeotrigger created from an AGSLocationDataSource.

The AGSGeotriggerFeed is the dynamic component of an AGSGeotrigger. Typically, it is the data that moves around and triggers the condition. For example, if the condition is "notify me when my position comes within 50 meters of one of my target areas", the feed data is "my position".

To receive location updates, the AGSLocationDataSource must be AGSLocationDataSource::started. If you call stop (AGSGeotriggerMonitor), the underlying AGSLocationDataSource will not be stopped for you. For example, it may continue to receive GPS readings.

If the AGSLocationGeotriggerFeed is from an AGSGeotrigger defined in an AGSGeotriggersInfo, you must supply an AGSLocationDataSource to provide the device location. Set the AGSLocationGeotriggerFeed::locationDataSource to your AGSLocationDataSource. For example, using the AGSLocationDisplay::dataSource.

An AGSFenceGeotrigger can also take into account floors within buildings. If the feature table used to create the AGSFeatureFenceParameters is referenced by an AGSFeatureLayer that is AGSFloorAware, and the AGSLocationDataSource used to create the AGSGeotriggerFeed includes AGSLocationSourcePropertiesKeys::floor information, then fences will only be entered when they are intersected by an AGSLocation on the correct floor. If the fence or location data does not include valid floor information, the floor is ignored and the fence is entered when it is intersected by the location.

A floor aware feature layer or table must be part of an AGSGeoModel that includes a valid AGSGeoModelFloorDefinition. All layers and tables that are used by the floor definition are loaded when the AGSGeotriggerMonitor is started.

An AGSLocation can contain floor property as part of AGSLocation::additionalSourceProperties. This is populated automatically by AGSIndoorsLocationDataSource, or can be supplied as part of your own implementation.

Since
100.12
Inheritance diagram for AGSLocationGeotriggerFeed:
AGSGeotriggerFeed AGSObject

Instance Methods

(instancetype) - init
 
(instancetype) - initWithLocationDataSource:
 

Class Methods

(instancetype) + locationGeotriggerFeed
 
(instancetype) + locationGeotriggerFeedWithLocationDataSource:
 

Properties

AGSArcadeExpressionfilter
 
AGSLocationDataSourcelocationDataSource
 

Method Documentation

◆ init

- (instancetype) init

Instantiates an empty AGSLocationGeotriggerFeed.

Since
100.12

◆ initWithLocationDataSource:

- (instancetype) initWithLocationDataSource: (AGSLocationDataSource *)  locationDataSource

Instantiates an AGSLocationGeotriggerFeed with an AGSLocationDataSource.

Parameters
locationDataSourceA location data source that provides updates for the device location.
Since
100.12

◆ locationGeotriggerFeed

+ (instancetype) locationGeotriggerFeed

Instantiates an empty AGSLocationGeotriggerFeed.

Since
100.12

◆ locationGeotriggerFeedWithLocationDataSource:

+ (instancetype) locationGeotriggerFeedWithLocationDataSource: (AGSLocationDataSource *)  locationDataSource

Instantiates an AGSLocationGeotriggerFeed with an AGSLocationDataSource.

Parameters
locationDataSourceA location data source that provides updates for the device location.
Since
100.12

Property Documentation

◆ filter

- (AGSArcadeExpression*) filter
readwritenonatomicstrong

An AGSArcadeExpression that controls whether an update from the AGSLocationGeotriggerFeed is sent to an AGSGeotriggerMonitor.

The expression uses the Arcade language to determine whether feed entity updates are suitable for monitoring. The AGSArcadeExpression must evaluate to a boolean where:

  • YES indicates that the update will be used.
  • NO indicates that the update will not be used.

Filtering out undesirable updates reduces inaccurate notifications from your AGSGeotriggerMonitor. For example, you could filter out GPS updates where the horizontal accuracy is poor, to avoid false enter and exit notifications.

With an AGSLocationGeotriggerFeed, the expression inspects a new AGSLocation object and returns true if it is suitable and false if not. Typically, your expression excludes AGSLocation objects where the AGSLocation::horizontalAccuracy does not meet your criteria - but it could also consider other properties such as AGSLocation::velocity and AGSLocation::course.

Arcade gives you access to the properties of the feed entity with the $locationupdate profile variable. This represents a new AGSLocation received from your device GPS. For example, an AGSArcadeExpression with the following string rejects AGSLocation updates with a horizontal accuracy greater than 10 meters:

return $locationupdate.horizontalaccuracy <= 10;

Since
100.13

◆ locationDataSource

- (AGSLocationDataSource*) locationDataSource
readwritenonatomicstrong

The location data source that provides updates for the device location.

To receive location updates, the AGSLocationDataSource must be AGSLocationDataSource::started. If you call stop (AGSGeotriggerMonitor), the underlying AGSLocationDataSource is not stopped for you. In other words, it may continue to receive GPS readings.

Since
100.12