Quick Start
iOS
Check our public sample application for an actual implementation of the snippets below and how they can be utilized.
Overall Code
A quick start snippet will look something like this in your app's willFinishLaunchWithOptions
:
This snippet assumes that the required configurations and permissions are already setup to work. Check permissions handling section for more details.
Breakdown
Let us break down the overall code block into the following:
SDK Authorization
The MoveAuth will look something like this:
If the provided MoveAuth was invalid, the SDK will not initialize and complete with MoveConfigurationError.authInvalid
. Check Initialization for more details about possible outcomes.
Authentication Expiry
The host app is expected to monitor MoveAuthState updates viaauthStateChangeListener
(iOS) API and handle those changes accordingly.
Check Authentication updates and expiry for more details about authentication expiry and renewal.
SDK Configuration
MoveConfig allows host apps to configure which of the licensed Move services should be enabled. It could be based on each user preference or set from a remote server.
iOS System Permissions
Based on the passed MoveConfigs oninitialization
, the SDK determines the required permissions to activate the requested services.
The host app must verify that all the permissions required for the passed configs are granted.
In case the required permissions were missing when calling SDK initialization API, the MoveSDKState will transit to permissionMissing
error MoveSDKState other than ready
MoveSDKState.
Check permission handling for details about permissions required for each service.
The MoveConfig will look something like this:
SDK State
The host app is expected to set its SDKStateListener
before initializing the SDK to intercept the MoveSDKState changes caused by calling the initialize
API.
The provided block could then start the SDK when MoveSDKState is ready
or handle errors if occurred. The provided block could look something like this:
Only calling startAutomaticDetection
API will transit MoveSDKState is ready state.
SDK Initialization
Theinitialization
API must be executed beforedidFinishLaunchingWithOptions
returns. We recommend calling it inwillFinishLaunchingWithOptions
.
Exceptions might apply, where the SDK is not initialized on app launch. First initialization is a good example, where the app would only initialize the SDK after onboarding the user and requesting permissions.
Check Initialization Timing for more details about the importance of adequately initializing the SDK.
Last updated