Listeners/Callbacks

MOVE Models

SDK State Listener

Triggers whenever the MoveSDKState changes.

Set an MOVE SDK State listener usingsdkStateListener(Android/iOS) API to anticipate handling the MOVE SDK State changes, start detection services when MoveSDKState is .ready or handle.error if occurred.

interface StateListener {
    fun onStateChanged(sdk: MoveSdk, state: MoveSdkState)
}

Parameter

Latest MoveSDKState.

Auth State Update Listener

Triggers whenever the MoveAuthState changes.

Authentication Expiry

The host app is expected to monitor MoveAuthState updates via authStateUpdateListener API and handle those changes accordingly.

Check Authentication updates and expiry for more details about authentication expiry and renewal.

interface AuthStateUpdateListener {
    fun onAuthStateUpdate(state: MoveAuthState)
}

Trip State Listener

Triggers whenever the MoveTripState changes.

interface TripStateListener {
    fun onTripStateChanged(sdk: MoveSdk, tripState: MoveTripState)
}

Trip Metadata Provider

Triggers whenever a trip is ending, for the host app to append metadata along with that trip if needed.

interface TripMetadataProvider {
    fun provideMetadata(start: Long, end: Long): Map<String, String>
}

Parameter

start/tripStart

Long/Date

Trip start timestamp/date.

end/tripEnd

Long/Date

Trip end timestamp/date.

Return

A String dictionary of the trip's metadata.

Device Status Callback

Triggers whenever MoveDeviceStatus changes.

typealias MoveDeviceStatusCallback = (_ status: MoveDeviceStatus) -> Void

Service Failure Callback

Triggers whenever MoveServiceFailures change.

interface MoveErrorListener {
    fun onMoveError(serviceFailures: List<MoveServiceFailure>)
}

Service Warning Callback

Triggers whenever MoveServiceWarnings change.

interface MoveWarningListener {
    fun onMoveWarning(serviceWarnings: List<MoveServiceWarning>)
}

Initialization Listener

Represents the potential errors occurring when updating the MoveAuth.

interface InitializeListener {
    fun onError(error: MoveConfigurationError)
}

Parameter

error

An error to notify when the configuration could

not be loaded from the server.

Log Callback

Triggers whenever a new log event occurs.

interface MoveLogCallback {
    fun onLogReceived(eventName: String, value: String?)
}

Parameter

log

String

New log event.

value

String

Log value.

Last updated

Change request #70: add MoveSdkAndroidConfig model