SDK State Listener
Triggers whenever the 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 changes.
Authentication Expiry
The host app is expected to monitor updates via authStateUpdateListener
API and handle those changes accordingly.
Check for more details about authentication expiry and renewal.
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
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.
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
iOS
Copy typealias MoveDeviceStatusCallback = (_ status: MoveDeviceStatus) -> Void
Service Failure Callback
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
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
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
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
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
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
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
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>>