Services
iOS
Shared Instance
Use the shared instance as your interface to the MOVE SDK.
Detection Services
Start Automatic Detection
Starts the required detection services stated in the MoveConfig passed on initialization. Starting the service will set the MoveSDKState to .running
.
Precondition: SDK should be in.ready
MoveSDKState
Stop Automatic Detection
Stops the automatic detection service, including all SDK services like driving detection, points of interest, walking and places. Stopping the service will set the MoveSDKState back to .ready
.
Precondition: SDK should be in.running
MoveSDKState.
Force Trip Recognition
Temporarily calibrates the SDK to the highest detection mode.
In order to optimize battery consumption, the SDK goes through different detection modes with different battery consumption levels, depending on the user's current behavior and activity. In general, the SDK is responsible for alternating between those different detection modes.
The SDK also provides hosting apps this API to call if they have their own reasons (like buttons, sensors or beacons) to believe that the user is starting a trip. This will make sure the SDK is on the highest detection state to detect the trip faster.
Precondition: SDK should be in.running
MoveSDKState.
Finish Current Trip
Ends the current ongoing trip.
This API will end the ongoing trip and set MoveTripState back to .idle
. The SDK is responsible for detecting the trip start and end points. The SDK also provides hosting apps this API to call if they have their own reasons (like sensors or beacons) to believe that the user's trip has ended.
Precondition: MoveTripState should be in an active trip.
If this API is called while the user is active on a driving trip, a new trip will start again right away. If the intention is to un-track the ongoing trip, call ignoreCurrentTrip
API.
More information about trip states can be found in MoveTripState.
Ignore Current Trip
Ignores the current ongoing trip.
This API will set the ongoing MoveTripState to .ignored
. Data of ignored trips is purged and not sent to the server.
Precondition: MoveTripState should be in an active trip.
Processing Services
Get SDK State
Gets the current MoveSDKState.
Return
Latest SDK State
Set SDK State Listener
Provide a block to be invoked every time MoveSDKState changes.
Set the MoveSDKState listener before initializing the SDK to anticipate the SDK State changes triggered by the initialization API.
Here the host app can start the SDK services when MoveSDKState is.ready
or handle errors if occurred.
Callback
Get SDK Auth State
Gets the current MoveAuthState.
Return
Latest SDK State
Set SDK Auth State Listener
Provide a block to be invoked every time MoveAuthState changes.
Callback
Authentication Expiry
The host app is expected to monitor MoveAuthState updates viaauthStateUpdateListener
(Android / iOS) API and handle those changes accordingly.
Check Authentication updates and expiry for more details about authentication expiry and renewal.
Get Trip State
Gets the current MoveTripState.
Return
Set Trip State Listener
Provide a block to be invoked every time MoveTripState changes.
Callback
Get Device Status
Gets the current MoveDeviceStatus.
Return
Set Device Status Listener
Provide a block to be invoked every time MoveDeviceStatus changes.
Callback
Set Metadata Listener
Provide a block returning bundle of key-value pairs to be appended to the trip metadata before the trip finishes.
Host apps can use this API to add any app-level information (for ex. Böuetooth beacon detected, foreground/background time, etc) to append to a trip as metadata. This metadata will be forwarded back along with the trip when fetched by the client-server, so the host app can utilize it in its app. Note: The SDK will not use this metadata element in any way, it is just passed through to the product.
The block provides the trip's start and stop times. Make sure to only include metadata events that are relevant for the given start and end periods.
Callback
Block that gets invoked on every trip finish. The block provides the trip's start and stop times.
Usage Example
Set Log Listener
Provide a block to be invoked every time a new SDK log event occurs.
Callback
Block that gets invoked with every new log event.
Set Console Logging State
Toggles console logging enabled state.
This doesn't affect recieving the logs via setLogListener(_ listener: MoveLogCallback)
API.
Enabled by default.
Parameter
enabled
Boolean that sets SDK console logging to enabled or not.
Delete Local Data
Deletes all the collected user SDK data stored on the device. This doesn't affect the MoveSDKState.
Precondition: MoveSDKState should be initialized.
Shutdown SDK
Shutdown SDK shared instance.
Stops SDK services, send the queued user data, and de-initializes the SDK. After that is executed, the MoveSDKState will transit to .uninitialized
.
Precondition: SDK should be initialized.
Synchronize User Data
Used to force synchronizing user data with the SDK server. Limited to once per 2 minutes.
Returns FALSE in case there are Timeline-relevant packages in the queue that remain to be sent to the SDK Backend; and it returns TRUE in case the queue is empty.
Configuration services
Update authentication
Updates SDK MoveAuth. On SDK auth expiry, the Builder.authStateListner will trigger expired state. The host app is expected to fetch a new MoveAuth using its product API key and pass it to the MoveSDK using the following API:
Parameter
auth
The user's updated Auth object with the new token.
Callback
completion
Last updated