MoveSDKState
Represent the different SDK States.
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 | |
error(MoveStateError) | The SDK is in an error state. Transited to this state in cases of error. |
MoveStateError | |
LocationPermissionMissing | Required location permission is missing. (https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION) |
MotionPermissionMissing | Required activity recognition permission is missing. (https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) |
PhonePermissionMissing | Required phone permission is missing. (https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE) |
OverlayPermissionMissing | Required system alert window permission is missing (https://developer.android.com/reference/android/Manifest.permission#SYSTEM_ALERT_WINDOW) |
Note: In case of resolving an error, the SDK needs to be notified via resolved()
method of the state-error object.
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.
Last updated