Dolphin MOVE SDK
SDK
1.x
1.x
  • Introduction
  • MOVE Services
  • MOVE SDK
    • Getting Started
      • MOVE Dashboard
      • Android
        • Installation
        • Quick Start
      • iOS
        • Installation
        • Quick Start
      • React Native
    • API Interface
      • Android
        • Initialization
        • Services
      • iOS
        • Initialization
        • Services
      • React Native
        • Initialization
        • Services
    • Models
      • MoveAuth
      • MoveConfig
      • MoveConfigurationError
      • MoveDeviceStatus
      • MoveSDKState
      • MoveTripState
      • MoveAuthState
      • Listeners/Callbacks
    • Appendix
      • Android
        • Token refresh
        • Permission Handling
        • Battery optimization
        • Notification Management
      • iOS
        • Permissions Handling
        • App Store
  • MOVE Backend
    • MOVE Timeline
    • MOVE State
    • MOVE Last Location
    • MOVE Generic Notifier
    • Open Api Specification
  • Changelog
    • Android
    • iOS
  • Data privacy (GDPR)
Powered by GitBook
On this page
  • Initialize Listener
  • SDK State Listener
  • Auth State Update Listener
  • Trip State Listener
  • Trip Metadata Provider
  • Device Status Callback
  • Log Callback
  1. MOVE SDK
  2. Models

Listeners/Callbacks

PreviousMoveAuthStateNextAppendix

Last updated 3 years ago

Initialize Listener

Triggers if occurs on initialization (/).

interface InitializeListener {
    fun onError(error: MoveConfigurationError)
}
typealias MoveIntializationCallback = ((_ confgError: MoveConfigurationError?) -> Void)?

Parameter

SDK State Listener

Triggers whenever the changes.

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

interface StateListener {
    fun onStateChanged(sdk: MoveSdk, state: MoveSdkState)
}
typealias MoveSDKStateCallback = (_ state: MoveSDKState) -> Void

Parameter

Auth State Update Listener

Authentication Expiry

interface AuthStateUpdateListener {
    fun onAuthStateUpdate(state: MoveAuthState)
}
typealias MoveAuthStateCallback = (_ state: MoveAuthState) -> Void

Parameter

Trip State Listener

interface TripStateListener {
    fun onTripStateChanged(sdk: MoveSdk, tripState: MoveTripState)
}
typealias MoveTripStateCallback = (_ tripState: MoveTripState) -> Void

Parameter

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>
}
typealias MoveMetaDataCallback = (_ tripStart: Date, _ tripEnd: Date) -> [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

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

Parameter

Log Callback

Triggers whenever a new log event occurs.

typealias MoveLogCallback = (_ log: String) -> Void

Parameter

log

String

New log event.

Potiential on initilazation (/).

Latest .

Triggers whenever the changes.

The host app is expected to monitor updates viaauthStateUpdateListener( / ) API and handle those changes accordingly.

Check for more details about authentication expiry and renewal.

Latest .

Triggers whenever the changes.

Latest .

Triggers whenever changes.

Latest .

MoveAuthState
MoveTripState
MoveDeviceStatus
MoveConfigurationError
MoveSDKState
MoveSDKState
MoveAuthState
MoveAuthState
MoveTripState
MoveTripState
MoveDeviceStatus
MoveDeviceStatus
MoveConfigurationError
MoveSDKState
MoveSDKState
MoveAuthState
MoveConfigurationError
Authentication updates and expiry
iOS
iOS
iOS
iOS
Android
Android
Android
Android