For the complete documentation index, see llms.txt. This page is also available as Markdown.

MoveSDKState

Represent the different SDK States.

sealed class MoveSdkState {
    Uninitialised()
    Ready()
    Running()
    Error(reason: MoveStateError)
}


MoveStateError { 
    LocationPermissionMissing
    PhonePermissionMissing
    OverlayPermissionMissing
    MotionPermissionMissing;
    
    fun resolved()
}
enum MoveSDKState {
    case unintialized
    case ready
    case running
    case error(StateError)
 
    enum StateError {
        case locationPermissionMissing
        case locationPrecisionPermissionMissing
        case motionPermissionMissing
        case sensorsInvalid
    }
}

MoveState

uninitialized

The SDK is not initialized.

ready

The SDK is initialized and ready to start services. Transited to this state on successful initialization and when services didn't start.

running

The SDK is running its services. Transited to this state after calling startAutomaticDetection() (in Android / iOS).

error(MoveStateError)

The SDK is in an error state. Transited to this state in cases of error.

MoveStateError

LocationPermissionMissing

MotionPermissionMissing

PhonePermissionMissing

OverlayPermissionMissing

Note: In case of resolving an error, the SDK needs to be notified via resolved() method of the state-error object.

StateError

locationPermissionMissing

Required location permission is missing.

locationPrecisionPermissionMissing

Required location precision permission is missing.

motionPermissionMissing

Required motion permission is missing.

sensorsInvalid

Required sensors are not available.

Upon initializing the SDK, it will evaluate the system's services and required permissions (for Android / iOS) to activate the SDK detection services requested by the host app in the passed MoveConfig. The SDK is successfully ready to start its services only if all the required services are available and all the required permissions are granted. The SDK will not transit to .ready MoveSDKState except when all its requirements are fulfilled.

Required and optional permissions are determined based on the passed MoveConfig on initialization. Check MoveConfig and permissions handling (Android / iOS) for more details about configurations and permission requirements.

The host app is expected to monitor MoveSDKState changes via setSDKStateListener to handle the MoveSDKState transitions accordingly.

When the SDK transits to an error state, it either will be a:

  • Permission error: In this case, the host app is expected to handle this missing permission (for Android / iOS) in its app accordingly. When the missing required permission is granted, the SDK will transit back to .ready MoveSDKState waiting to start.

  • MoveAuth Expired: In this case, the host app is expected to fetch a new MoveAuth from the SDK server to renew the session.

Last updated