Services
API Interface / iOS
Last updated
API Interface / iOS
Last updated
Shared Instance
Use the shared instance as your interface to the MOVE SDK.
Starts the required detection services stated in the passed on initialization. Starting the service will set the to .running
.
Precondition: SDK must be in.ready
Returns false if the SDK is not in .ready
state.
Stops the automatic detection service, including all SDK services like driving detection, points of interest, walking and places. Stopping the service will set the back to .ready
.
Precondition: SDK must be in.running
.
Returns false if the SDK is not in .ready
state.
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.
Returns false if the SDK is not in .ready
state.
Ends the current ongoing trip.
Ignores the current ongoing trip.
Provides a block to be invoked when a trip actually begins.
In comparison to the tripStateListener (only state changes) the tripStartListener will provide you with the start time of the actual trip.
Return
Latest SDK State
Callback
Return
Callback
Return
Return
A list of failed services.
Callback
Block that gets invoked when service failure state changes.
Return
A list of partially working services.
Callback
Block that gets invoked when service warnings change.
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. Bluetooth 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 project environment.
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
Provide a block to be invoked every time a new SDK log event occurs.
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.
Parameter
Block that get's invoked when the health score changes.
Geo-coordinate address lookup.
Parameter
latitude
Geo-coordinate latitude
longitude
Geo-coordinate longitude
completion
Geocode will use Apple's builtin CLGeocoder.reverseGeocodeLocation or fallback to contacting the MOVE backend to attempt a geo-lookup.
Throttle: Geocode is limited to a maximum of 100 lookups per hour.
CLGeocoder.reverseGeocodeLocation has its own throttling and maybe used up for the app calling this function.
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.
Adds a Tag (=string value) to trip events. This tag information is added to the timeline data.
To clear the Tag pass null
as parameter.
Parameters
tag
String [a-z] [0-9]
and null
to clear the Tag.
Return values
true
Live Location Tag is applied.
true
Live Location Tag is cleared. (parameter null
)
false
Live Location Tag exceeds the limit of 200 characters.
false
Live Location Tag is blank or empty.
false
If the passed chars are not one of these [a-z] [0-9].
Initiate an assistance call to emergency services.
Parameters
completionHandler
The application should process the callback status and inform the user in case of failure.
Precondition: The assistance call service needs to be configured in the MOVE dashboard. The SDK needs to be in ready or running state.
New feature in MOVE SDK 2.1
Parameters
metadata
A string to be sent with each assistance call or impact
The metadata string is sent to the server with each manual assistance call and with each AID report. The contents of the string can be anything, e.g. JSON data. The assistance data is persisted once set.
New feature in MOVE SDK 2.2
Get a unique qualifier to identify the individual device.
Device discovery for iBeacon and Audio devices. Multiple devices can be registered but limitations of CLLocationManager
region API may apply.
If stopScanOnFirstDiscovered
is set the scan stops after any device is discovered.
Device scanning results are appended to the trip metadata.
Registering/unregistering devices during a trip may result in undefined behavior.
Register an additional device:
Unregister a device:
Get current registered devices.
Callback
Block that gets invoked whenever a scan for registered devices completes.
Parameters
Parameters
listener
A callback returning a MoveConfig object after a successful server fetch.
Precondition: SDK must be in.running
.
Manually force the start of a trip, bypassing trip validation checks. This non-standard SDK usage may be feasible only in situations where active user input can be expected. Using the metadata parameter, self-defined information can be added to each trip which can be fetched from the .
Precondition: MOVE SDK must be inREADY
.
Manually starting a trip bypasses additional trip detection checks. Manually started trips must be ended with
It is recommended not to use motionPermissionMandatory
or backgroundLocationPermissionMandatory
with this API, as they will be ignored.
This API will end the ongoing trip and set 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: should be in an active trip.
More information about trip states can be found in .
If the trip was started with finishCurrentTrip()
brings the SDK back to READY state.
This API will set the ongoing to .ignored
. Data of ignored trips is purged and not sent to the server.
Precondition: should be in an active trip.
Gets the current.
Provide a block to be invoked every time changes.
Set the listener before initializing the SDK to anticipate the SDK changes triggered by the initialization API.
Here the host app can start the SDK services when is.ready.
Block that gets invoked every time is changed and provides the updated .
Gets the current .
Current
Provide a block to be invoked every time changes.
Block that gets invoked every time is changed and provides the updated .
Gets the current .
Current
Gets the current .
List of
Provide a block to be invoked every time change.
Gets the current .
List of .
Provide a block to be invoked every time change.
Callback that returns a Result with an address String or a
Deletes all the collected user SDK data stored on the device. This doesn't affect the .
Precondition: should be initialized.
After a shutdown(...)
( / ) the tag is also cleared.
New feature in MOVE SDK 2.x; configuration in MOVE dashboard pending - please .
A callback returning a .
The device qualifier should be passed to the backend during user registration. See .
From the start of a trip registered devices are scanned after a period deviceDetectionDelay
, beacons are scanned for a duration deviceDetectionDuration
repeated after an interval deviceDetectionInterval
, see .
All devices are unregistered after .
Set a device discovery listener to be fired when registered s are scanned. It returns a list of the devices registered with register(devices: [MoveDevice])
. If the option is set the list may be incomplete.
Set a connection state listener to be fired when the connection state of a previously registered has changed. Only works with paired audio devices, not iBeacons.
A callback returning the which connection state was changed.
Provide a block to be invoked every time was successfully fetched from the server.
If the MoveConfig object couldn't be fetched from the server then a ServiceUnreachable will be triggered.