EILBackgroundIndoorLocationManager Class Reference

Inherits from NSObject
Declared in EILBackgroundIndoorLocationManager.h
EILBackgroundIndoorLocationManager.m

Overview

Background Indoor Location Manager class provides position updates in background.

In order to relaunch the application (if it is killed by operating system or user) as the user enters the location “Always in use” Location Services authorization is required.

Please note that when the application is relaunched in background no UI code is executed. All the logic regarding positioning in background should be executed in the App Delegate including recreating an instance of EILBackgroundIndoorLocationManager.

Other Methods

  delegate

The delegate object to receive position update events.

@property (nonatomic, weak, nullable) id<EILBackgroundIndoorLocationManagerDelegate> delegate

Declared In

EILBackgroundIndoorLocationManager.h

– requestAlwaysAuthorization

Requests permission to use location services whenever the app is running.

- (void)requestAlwaysAuthorization

Discussion

“Always in use” Location Services authorization is required for the background manager to be able to relaunch the app, if it is killed by operating system or user.

For more details about the location services authorization model please refer to the CoreLocation documentation.

For best UX patterns for requesting permission please refer to the following blog post: http://blog.estimote.com/post/144805191465/how-to-ask-users-for-permission-to-use-location

See Also

  • [CLLocationManager requestWhenInUseAuthorization]

Declared In

EILBackgroundIndoorLocationManager.h

– start

Starts Background Indoor Location Manager.

- (void)start

Discussion

Starting Background Indoor Location Manager early allows it to warm-up and later on deliver without delay Indoor Location status change and position updates.

Declared In

EILBackgroundIndoorLocationManager.h

– stop

Completely stops Background Indoor Location Manager.

- (void)stop

Discussion

Invoking this method will stop all Indoor Location monitoring and position updates.

Declared In

EILBackgroundIndoorLocationManager.h

  isRunning

Informs whether Background Indoor Location Manager is currently running.

@property (nonatomic, assign, readonly) BOOL isRunning

Declared In

EILBackgroundIndoorLocationManager.h

Indoor Location Monitoring

– startMonitoringForLocation:

Starts monitoring the specified Indoor Location allowing you determine if you are inside or outside monitored location.

- (void)startMonitoringForLocation:(EILLocation *)location

Parameters

location

The Indoor Location object that defines the boundary to monitor.

Discussion

To function properly Background Location Manager requires “Always in use” Location Services authorization.

The current state, i.e., inside/outside, is available on-demand, by calling the stateForLocation: method.

If the Background Indoor Location Manager is not started this method will start it.

Starting monitoring for Indoor Location early allows position updates to be delivered without delay later on.

Starting monitoring for a location already monitored will do nothing.

Declared In

EILBackgroundIndoorLocationManager.h

– stopMonitoringForLocation:

Stops monitoring the specified Indoor Location.

- (void)stopMonitoringForLocation:(EILLocation *)location

Parameters

location

The Indoor Location object currently being monitored. The object you specify need not be the exact same object that you registered, but its identifier or name should be the same.

Declared In

EILBackgroundIndoorLocationManager.h

  monitoredLocations

The set of all monitored Indoor Locations.

@property (nonatomic, strong, readonly) NSSet<EILLocation*> *monitoredLocations

Declared In

EILBackgroundIndoorLocationManager.h

– stateForLocation:

Determines state for the monitored location.

- (EILLocationState)stateForLocation:(EILLocation *)location

Parameters

location

An EILLocation object for which state should be determined.

Return Value

State in which the monitored location is.

Discussion

If the location is not monitored EILLocationStateUnknown will be returned.

Declared In

EILBackgroundIndoorLocationManager.h

– stateForLocationWithIdentifier:

Determines state for the monitored location identified by its identifier.

- (EILLocationState)stateForLocationWithIdentifier:(NSString *)locationIdentifier

Parameters

locationIdentifier

An identifier of the location for which state should be determined.

Return Value

State in which the monitored location is.

Discussion

Each location saved in Estimote Cloud is given a unique string identifier that corresponds to the identifier property of EILLocation. You can find it on cloud.estimote.com, on the “Locations” screen, and use it with the Indoor SDK to, among other things, fetch your stored location from Estimote Cloud.

If the location is not monitored EILLocationStateUnknown will be returned.

Declared In

EILBackgroundIndoorLocationManager.h

Indoor Location Position Updates

– startPositionUpdatesForLocation:

Starts the delivery of position updates for the specified location.

- (void)startPositionUpdatesForLocation:(EILLocation *)location

Parameters

location

The location.

Discussion

To function properly Background Location Manager requires “Always in use” Location Services authorization.

If the Background Indoor Location Manager is not started invoking this method will start it.

Calling this method without calling start startMonitoringForLocation: will result in approximately 6 s delay before first position updates are provided. Starting monitoring earlier will reduce this time by the amount of time monitoring was running.

Declared In

EILBackgroundIndoorLocationManager.h

– stopPositionUpdatesForLocation:

Stops the delivery of position updates for the specified location.

- (void)stopPositionUpdatesForLocation:(EILLocation *)location

Parameters

location

The location.

Declared In

EILBackgroundIndoorLocationManager.h

– stopPositionUpdates

Stops the delivery of position updates.

- (void)stopPositionUpdates

Declared In

EILBackgroundIndoorLocationManager.h