iOS – Programming a minimal Point SDK app

Introducing BDLocationManager

BDLocationManager is the entry-point for an app to start using Point SDK.

Point SDK acts upon rules that are defined via the Canvas web-interface. To enable these within an application, it is necessary to call the authentication method on the shared instance of BDLocationManager. A Project ID is used as the parameter.

Calling the authentication method will start a session with Canvas. However, it’s not required to call this method after app restart unless the user has been logged out. Initialising an SDK in AppDelegate make the enhanced restart mode work correctly.

Zones will be downloaded, and associated Actions will be executed by the library without any further intervention. In general, the singleton instance of BDLocationManager should be used wherever the standard Core Location CLLocationManager class would otherwise be used.

BDLocationManager is a subclass of CLLocationManager and is intended to be a drop-in replacement, while also providing additional features.

BDLocationManager exposes properties for two delegates, in addition to the standard delegate property inherited from CLLocationManager:

  1. sessionDelegate implements the BDPSessionDelegate protocol.
  2. locationDelegate implements the BDPLocationDelegate protocol.

The most notable of these additional features are:

  1. Session Delegate – the BDPSessionDelegate protocol provides callbacks informing the application when Point SDK’s authentication state changes. The rules defined in Canvas will only be observed while authenticated. Also, some methods of Point SDK classes may just be called while the application is in the authenticated state and will otherwise cause an exception to be thrown. Such restrictions are documented clearly in this API reference. It is only necessary to authenticate once during the runtime of the application.
  2. Location Delegate – following the delegate pattern familiar throughout Apple’s Cocoa Touch frameworks, the locationDelegate property of BDLocationManager provides callbacks to notify an application when:

a. zone information is received. This typically occurs immediately after the authentication process completes.

- (void)didUpdateZoneInfo:

b. Any Zones defined in Canvas are triggered, in real-time.
Either of two call-backs will be made, depending on whether a check-in was triggered by the device entering a Geofence.

- (void)didCheckIntoFence:inZone:atCoordinate:onDate:willCheckOut:

c. Following (b), if the willCheckOut flag was set to true, either of the following corresponding call-backs will also be made when the device leaves the checked-in area:

- (void)didCheckOutFromFence:inZone:onDate:withDuration:
Created by Bluedot DevOps on June 19, 2018

Start the discussion