Dolphin MOVE SDK
2.x
2.x
  • Introduction
  • MOVE Services
  • MOVE SDK
    • Getting Started
      • MOVE Dashboard
        • Access Control
        • Configuration
        • Timeline
        • Points of Interest
      • Android
        • Installation
        • Quick Start
      • iOS
        • Installation
        • Quick Start
        • Troubleshooting
      • React Native
      • Flutter
      • Move SDK CLI
    • API Interface
      • Android
        • Initialization
        • Services
      • iOS
        • Initialization
        • Setup
        • Services
      • React Native
        • Components
        • Initialization
        • Services
      • Flutter
        • Initialization
        • Services
    • Models
      • Listeners/Callbacks
      • MoveAssistanceCallStatus
      • MoveAuth
      • MoveAuthError
      • MoveAuthResult
      • MoveAuthState
      • MoveConfig
      • MoveConfigurationError
      • MoveDevice
      • MoveDeviceStatus
      • MoveGeocodeError
      • MoveHealthItem
      • MoveHealthScore
      • MoveOptions
        • DeviceDiscovery
      • MoveSdkState
      • MoveSdkAndroidConfig
      • MoveTripState
      • MoveScanResult
      • MoveServiceFailure
      • MoveServiceWarning
      • MoveShutdownResult
    • Appendix
      • Token refresh
      • Android
        • Permission Handling
          • Permission Overview
          • Runtime Permissions
        • Battery optimization
        • Notification Management
        • Forcing the Signal - Classic Bluetooth
      • iOS
        • Permissions Handling
        • App Store
      • React Native
        • Permission Handling
  • MOVE Backend
    • MOVE Backend
      • MOVE Admin API
      • MOVE TIMELINE API
      • MOVE State API
      • MOVE Last Location API
    • MOVE Generic Notifier
    • MOVE Assistance Notifier
    • Example requests
  • FAQ
  • Changelog
    • Android
    • iOS
    • React
    • Flutter
    • Backend
  • Data privacy (GDPR)
Powered by GitBook
On this page
  • SDK State Listener
  • Auth State Update Listener
  • Trip State Listener
  • Trip Start Listener
  • Trip Metadata Provider
  • Device Status Callback
  • Service Failure Callback
  • Service Warning Callback
  • Initialization Listener
  • Log Callback
  • Remote Config Change Listener
  • Setup Authorization Callback
  • Device Discovery Listener
  • MoveDevice State Listener / Callback
  • SDK Health Listener / Callback
  1. MOVE SDK
  2. Models

Listeners/Callbacks

MOVE Models

PreviousModelsNextMoveAssistanceCallStatus

Last updated 2 months ago

SDK State Listener

Triggers whenever the changes.

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

For android platform it is necessary to start listen explicitly by calling:

if (Platform.OS === 'android') {
    MoveSdk.startNativeSdkStateListener();
}
interface StateListener {
    fun onStateChanged(sdk: MoveSdk, state: MoveSdkState)
}
typealias MoveSDKStateCallback = (_ state: MoveSDKState) -> Void
static addSdkStateListener(sdkStateChanged: (state: SdkState) => void): ListenerSubscription;
Stream<MoveState>

Parameter

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.

interface AuthStateUpdateListener {
    fun onAuthStateUpdate(state: MoveAuthState)
}
typealias MoveAuthStateCallback = (_ state: MoveAuthState) -> Void
static addAuthStateListener(authStateChanged: (event: AuthStateEvent) => void): ListenerSubscription;
Stream<MoveAuthState>

Parameter

Trip State Listener

interface TripStateListener {
    fun onTripStateChanged(sdk: MoveSdk, tripState: MoveTripState)
}
typealias MoveTripStateCallback = (_ tripState: MoveTripState) -> Void
static addTripStateListener(tripStateChanged: (state: TripState) => void): ListenerSubscription;
Stream<MoveTripState>

Parameter

Trip Start Listener

Triggers whenever a trip actually starts.

interface TripStartListener {
    fun onTripStarted(startDate: Date)
}
typealias MoveTripStartCallback = (_ startDate: Date) -> Void
MoveSdk.addTripStartListener(tripStartTriggered: (start: Date) => void): ListenerSubscription;

Parameter

Date

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.

Trip Metadata is only available for car, cycling, train, tram, metro, and bus items. Metadata is also unavailable if public transport data is sourced from POIs.

interface TripMetadataProvider {
    fun provideMetadata(start: Long, end: Long): Map<String, String>
}
typealias MoveMetaDataCallback = (_ tripStart: Date, _ tripEnd: Date) -> [String: String]

Parameter

Type

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

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

Parameter

Service Failure Callback

interface MoveErrorListener {
    fun onMoveError(serviceFailures: List<MoveServiceFailure>)
}
public typealias MoveServiceFailureCallback = (_ permissions: [MoveServiceFailure]) -> Void
static addErrorsListener(errorsReceived: (errors: ErrorListType) => void): ListenerSubscription;
Stream<List<MoveServiceError>>

Parameter

Service Warning Callback

interface MoveWarningListener {
    fun onMoveWarning(serviceWarnings: List<MoveServiceWarning>)
}
public typealias MoveServiceWarningCallback = (_ permissions: [MoveServiceWarning]) -> Void
static addWarningsListener(warningsReceived: (warnings: ErrorListType) => void): ListenerSubscription;
Stream<List<MoveServiceWarning>>

Parameter

Initialization Listener

interface InitializeListener {
    fun onError(error: MoveConfigurationError)
}
public typealias MoveInitializationCallback = (_ error: MoveConfigurationError) -> Void

Parameter

Type

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?)
}
typealias MoveLogCallback = (_ log: String, _ value: String) -> Void
static addLogListener(logReceived: (event: MoveSdkLog) => void): ListenerSubscription;

export type MoveSdkLog = {
  message: string;
  value?: string;
};

Parameter

Type

log

String

New log event.

value

String

Log value. Optional

The SDK will trigger log messages to improve debugging.

Remote Config Change Listener

Since MOVE SDK v2.5

interface RemoteConfigChangeListener {
    fun onConfigChanged(config: MoveConfig)
}
typealias MoveRemoteConfigChangeCallback = (_ config: MoveConfig) -> Voidstatic addConfigChange(warningsReceived: (warnings: ErrorListType) => void): ListenerSubscription
static addRemoteConfigChangeListener(configChangeReceived: (config: Array<IssueListService>) => void): ListenerSubscription
Stream<MoveConfig>

Setup Authorization Callback

Since MOVE SDK v2.9

interface MoveAuthCallback {
    fun onResult(result: MoveAuthResult)
}
typealias MoveAuthCallback = (_ result: MoveAuthResult) -> Void

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

Since MOVE SDK v2.4

interface DeviceDiscoveryListener {
    fun onScanResult(results: List<MoveScanResult)
}
typealias MoveDeviceDiscoveryCallback = (_ results: [MoveScanResult]) -> Void
static addDeviceDiscoveryListener(onScanResult: (state: Array<MoveScanResult>) => void): ListenerSubscription
Stream<List<MoveScanResult>>

Parameter

results

MoveDevice State Listener / Callback

Since MOVE SDK v2.10.0

interface MoveDeviceStateListener {
    fun onStateChanged(device: MoveDevice)
}
public typealias MoveDeviceStateCallback = (_ results: [MoveDevice]) -> Void
static addDeviceStateListener(onScanResult: (results: Array<MoveSdkDevice>) => void): ListenerSubscription
Stream<List<MoveDevice>>

SDK Health Listener / Callback

Since MOVE SDK v2.11.0

interface MoveHealthScoreListener {
    fun onMoveHealthScoreChanged(score: MoveHealthScore)
}
public typealias MoveHealthScoreCallback = (_ result: [MoveHealthItem]) -> Void
static addHealthListener(scoreReceived: (health: MoveHealthScore) => void): ListenerSubscription
Stream<List<MoveHealthItem>>

Latest .

Latest .

Triggers whenever the changes.

Latest .

Triggers whenever changes. represents the current device's system permissions (for / ) and services status.

Latest .

Triggers whenever change.

List of .

Triggers whenever change.

List of .

Represents the potential errors occurring when updating the .

Will be triggered when the was successfully fetched from the server via (Android) / (iOS).

If the MoveConfig object couldn't be fetched from the server then a ServiceUnreachable will be triggered.

Will return the success or failure of the internal MOVE SDK authentication process during . (also see )

Will be triggered during a scan.

List of 's

Will be triggered when the status of a registered changes. This must be previously registered. See chapters "Register Device" (, )

Will be triggered when the health score of the MOVE SDK changes. A (iOS, React Native) / (Android) with the current data is provided.

MoveTripState
MoveDeviceStatus
MoveDeviceStatus
Android
iOS
MoveServiceFailures
MoveServiceWarnings
MoveAuth
MoveConfigurationError
MoveHealthItem
MoveHealthScore
MoveSDKState
MoveSDKState
MoveAuthState
MoveAuthState
MoveTripState
MoveTripState
MoveDeviceStatus
MoveDeviceStatus
MoveServiceFailure
MoveServiceFailures
MoveServiceWarning
MoveServiceWarnings
MoveConfigurationError
MoveScanResult
MoveSDKState
MoveSDKState
MoveAuthState
MoveAuthState
MoveConfig
MoveAuthResult
MoveDevice
MoveDevice
update
updateConfig
BDD - Device Discovery
Android
iOS
Authentication updates and expiry
iOS
Android
setup