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
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 permissionMissingerror MoveSDKState other than readyMoveSDKState.
Check permission handling for details about permissions required for each service.
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:
MoveSDK.shared.setSDKStateListener { state in
switch state {
case .uninitialized:
/* SDK uninitialized*/
break
case .ready:
/* SDK initialised and ready to start the service*/
MoveSDK.shared.startAutomaticDetection()
case .running:
/* SDK Started Detection*/
break
case let .error(error):
switch error {
/* Hanlde SDK State Errors*/
default: break
}
}
}
SDK Initialization
MoveSDK.shared.initialize(auth: auth, config: sdkConfig, launchOptions: launchOptions) { initError in
if let error = initError {
switch error {
/* Hanlde SDK Initialization MoveConfigurationError*/
default: break
}
}
}