SDK State Listener
Triggers whenever the MoveSDKState changes.
For android platform it is necessary to start listen explicitly by calling:
Copy if (Platform.OS === 'android') {
MoveSdk.startNativeSdkStateListener();
}
Android iOS React Native Flutter
Copy interface StateListener {
fun onStateChanged(sdk: MoveSdk, state: MoveSdkState)
}
Copy typealias MoveSDKStateCallback = (_ state: MoveSDKState) -> Void
Copy static addSdkStateListener(sdkStateChanged: (state: SdkState) => void): ListenerSubscription;
Auth State Update Listener
Triggers whenever the MoveAuthState changes.
Android iOS React Native Flutter
Copy interface AuthStateUpdateListener {
fun onAuthStateUpdate(state: MoveAuthState)
}
Copy typealias MoveAuthStateCallback = (_ state: MoveAuthState) -> Void
Copy static addAuthStateListener(authStateChanged: (event: AuthStateEvent) => void): ListenerSubscription;
Copy Stream<MoveAuthState>
Trip State Listener
Triggers whenever the MoveTripState changes.
Android iOS React Native Flutter
Copy interface TripStateListener {
fun onTripStateChanged(sdk: MoveSdk, tripState: MoveTripState)
}
Copy typealias MoveTripStateCallback = (_ tripState: MoveTripState) -> Void
Copy static addTripStateListener(tripStateChanged: (state: TripState) => void): ListenerSubscription;
Copy Stream<MoveTripState>
Trip Start Listener
Triggers whenever a trip actually starts.
Android iOS React Native
Copy interface TripStartListener {
fun onTripStarted(startDate: Date)
}
Copy typealias MoveTripStartCallback = (_ startDate: Date) -> Void
Copy MoveSdk.addTripStartListener(tripStartTriggered: (start: Date) => void): ListenerSubscription;
The actual start time of the trip.
Trip Metadata Provider
This triggers whenever a trip is ending, allowing the host app to append metadata along with that trip if needed.
Android iOS
Copy interface TripMetadataProvider {
fun provideMetadata(start: Long, end: Long): Map<String, String>
}
Copy typealias MoveMetaDataCallback = (_ tripStart: Date, _ tripEnd: Date) -> [String: String]
Trip start timestamp / date.
Trip end timestamp / date.
A String dictionary of the trip's metadata.
Device Status Callback
Triggers whenever MoveDeviceStatus changes. MoveDeviceStatus represents the current device's system permissions (for Android / iOS ) and services status.
iOS
Copy typealias MoveDeviceStatusCallback = (_ status: MoveDeviceStatus) -> Void
Service Failure Callback
Triggers whenever MoveServiceFailures change.
Android iOS React Native Flutter
Copy interface MoveErrorListener {
fun onMoveError(serviceFailures: List<MoveServiceFailure>)
}
Copy public typealias MoveServiceFailureCallback = (_ permissions: [MoveServiceFailure]) -> Void
Copy static addErrorsListener(errorsReceived: (errors: ErrorListType) => void): ListenerSubscription;
Copy Stream<List<MoveServiceError>>
Service Warning Callback
Triggers whenever MoveServiceWarnings change.
Android iOS React Native Flutter
Copy interface MoveWarningListener {
fun onMoveWarning(serviceWarnings: List<MoveServiceWarning>)
}
Copy public typealias MoveServiceWarningCallback = (_ permissions: [MoveServiceWarning]) -> Void
Copy static addWarningsListener(warningsReceived: (warnings: ErrorListType) => void): ListenerSubscription;
Copy Stream<List<MoveServiceWarning>>
Initialization Listener
Represents the potential errors occurring when updating the MoveAuth .
Android iOS
Copy interface InitializeListener {
fun onError(error: MoveConfigurationError)
}
Copy public typealias MoveInitializationCallback = (_ error: MoveConfigurationError) -> Void
An error to notify when the configuration could
not be loaded from the server.
Log Callback
Triggers whenever a new log event occurs.
Android iOS React Native
Copy interface MoveLogCallback {
fun onLogReceived(eventName: String, value: String?)
}
Copy typealias MoveLogCallback = (_ log: String, _ value: String) -> Void
Copy static addLogListener(logReceived: (event: MoveSdkLog) => void): ListenerSubscription;
export type MoveSdkLog = {
message: string;
value?: string;
};
The SDK will trigger log messages to improve debugging.
Remote Config Change Listener
Will be triggered when the MoveConfig was successfully fetched from the server via updateConfig (Android) / update (iOS).
If the MoveConfig object couldn't be fetched from the server then a MoveConfigurationError ServiceUnreachable will be triggered.
Android iOS React Native Flutter
Copy interface RemoteConfigChangeListener {
fun onConfigChanged(config: MoveConfig)
}
Copy typealias MoveRemoteConfigChangeCallback = (_ config: MoveConfig) -> Voidstatic addConfigChange(warningsReceived: (warnings: ErrorListType) => void): ListenerSubscription
Copy static addRemoteConfigChangeListener(configChangeReceived: (config: Array<IssueListService>) => void): ListenerSubscription
Setup Authorization Callback
Will return the success or failure of the internal MOVE SDK authentication process during setup . (also see MoveAuthResult )
Android iOS React Native Flutter
Copy interface MoveAuthCallback {
fun onResult(result: MoveAuthResult)
}
Copy typealias MoveAuthCallback = (_ result: MoveAuthResult) -> Void
Copy object : MoveSdk.MoveAuthCallback {
override fun onResult(authResult: MoveAuthResult) {
uiThreadHandler.post {
...
when (authResult.status) {
AuthSetupStatus.SUCCESS -> result.success("success")
AuthSetupStatus.INVALID_CODE -> // e.g. result.error(...)
AuthSetupStatus.NETWORK_ERROR -> // e.g. result.error(...)
}
}
}
}
Device Discovery Listener
Will be triggered during a BDD - Device Discovery scan.
Android iOS React Native Flutter
Copy interface DeviceDiscoveryListener {
fun onScanResult(results: List<MoveScanResult)
}
Copy typealias MoveDeviceDiscoveryCallback = (_ results: [MoveScanResult]) -> Void
Copy static addDeviceDiscoveryListener(onScanResult: (state: Array<MoveScanResult>) => void): ListenerSubscription
Copy Stream<List<MoveScanResult>>
MoveDevice State Listener / Callback
Will be triggered when the status of a registered MoveDevice changes. This MoveDevice must be previously registered. See chapters "Register Device" (Android , iOS )
Android iOS React Native Flutter
Copy interface MoveDeviceStateListener {
fun onStateChanged(device: MoveDevice)
}
Copy public typealias MoveDeviceStateCallback = (_ results: [MoveDevice]) -> Void
Copy static addDeviceStateListener(onScanResult: (results: Array<MoveSdkDevice>) => void): ListenerSubscription
Copy Stream<List<MoveDevice>>
SDK Health Listener / Callback
Will be triggered when the health score of the MOVE SDK changes. A MoveHealthItem (iOS, React Native) / MoveHealthScore (Android) with the current data is provided.
Android iOS React Native Flutter
Copy interface MoveHealthScoreListener {
fun onMoveHealthScoreChanged(score: MoveHealthScore)
}
Copy public typealias MoveHealthScoreCallback = (_ result: [MoveHealthItem]) -> Void
Copy static addHealthListener(scoreReceived: (health: MoveHealthScore) => void): ListenerSubscription
Copy Stream<List<MoveHealthItem>>