iOS – Session Management

All communication with the back-end systems are within an encrypted, authenticated session; this requires a connection to the Internet via a mobile data network or WiFi. To initiate a session, the following method of BDLocationManager is called:

- (void)authenticateWithApiKey: requestAuthorization:

SDK persists an API key to continue to work after the restart.

Authentication life-cycle

The BDPSessionDelegate contains methods allowing an app to track the state changes within the SDK authentication life cycle. Methods are provided for notification of success, failure and the user logging out.

The authentication state property of BDLocationManager is also available as a KVO-Compliant property (@"authenticationState") to allow an app to monitor any changes as they occur.

Allocating the delegate

To access the session authentication callbacks, the delegate needs to be assigned to a class implementing the BDPSessionDelegate protocol. Generally, the session delegate of the BDLocationManager is assigned to the main AppDelegate.m module with:

BDLocationManager.instance.sessionDelegate = myDelegateImplementation;

Interacting with Point SDK

Some methods of Point SDK classes may only be called while authenticated and will otherwise cause an exception to be thrown. Individual restrictions are documented clearly in this API reference.

It is only necessary to authenticate once during the runtime of the application, however, if the user experience of the app requires Point SDK to be started and stopped based on specific user interactions with the app, then the authenticateWithApiKey or logout can be called at that point to manage the life cycle.

Created by Bluedot DevOps on June 19, 2018

Start the discussion