Services
API Interface / React Native
Last updated
API Interface / React Native
Last updated
Starts the required detection services stated in the passed on initialization. Starting the service will set the to .running
.
Promise will be resolved with 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
.
Promise will be resolved with false if the SDK is not in .running
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.
Ends the current ongoing trip.
Ignores the current ongoing trip.
Add 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 (only for current trip, when the next trip starts old metadata is removed). This metadata will be forwarded back along with the trip when fetched by the client-server. Note: The SDK will not use this metadata element in any way, it is just passed through to the project environment.
Promise will be resolved with false if the SDK is not in .ready
state.
When an Android application is in the background it may receive limited data (location, sensors, etc.). To improve this behaviour, it is possible to put the application always in the foreground with a visible notification that cannot be discarded. Just because it's visible it doesn't mean that it is performing any data collection at all. So this should not have any significant battery impact at all.
For android platform it is necessary to start listen explicitly by calling:
Callback
sdkStateChanged
Callback
authStateChanged
Callback
tripStateChanged
Add a log listener for debugging.
Shutdown SDK shared instance.
Precondition: SDK must be initialized.
Parameters
Default
force
true
When force: false
is specified the shutdown may fail when pending data cannot be uploaded and reject the promise (status code: NETWORK_ERROR
) which needs to be handled.
Used to force synchronizing user data with the SDK server. Limited to once per 2 minutes.
Initiate an assistance call to emergency services.
Precondition: The assistance call service needs to be configured in the MOVE dashboard. The SDK needs to be in ready or running state.
Parameters
String
A string to be sent with each assistance call or impact
The metadata string is set once, and then sent to the server with each and every manual assistance call and with AID report. The contents of the string can be anything, e.g. JSON data. The assistance data is persisted once set.
Parameters
Default
delay
60000
number
Delay in miliseconds.
callback
function
Callback that will be executed after delay.
Parameters
key
string
"Timer identifier" which was returned from setTimer
.
Adds a Tag to trip events. This Tag information is added to the timeline data. To clear the Tag do not pass 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 (no parameter is passed).
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].
auth
The user's updated Auth object with the new token.
Start scanning for devices which can be registered on the SDK for trip device discovery. A block will get invoked each time new devices are found.
sdkDevicesDetected
Listener
filter
MoveSdkDeviceFilter
Filter devices by type. See bellow.
uuid
string
UUID String required to scan beacons.
manufacturerId
number
Manufacturer ID needed to scan beacons.
Returns a subscription object. Scanning will stop automatically when the subscription is removed, otherwise the scan will continue and this will impact device battery usage.
A list of filters can be specified to filter which devices to scan for:
paired
Scan for paired devices. Default
connected
Scan for connected devices. New since version 2.10.4.
beacon
Scan for beacon devices. uuid
and manufacturerId
required.
Parameters
Unregister devices (MoveSdkDevice) to be discovered during trips.
Parameters
Block that get's invoked when the health score changes.
Parameters
listener
A callback returning a List of services after a successful server fetch.
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 .
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.
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
orbackgroundLocationPermissionMandatory
with
this API, as they will be ignored.
To save battery consumption, the SDK is using several triggers to start its data listeners. In case of trouble, these triggers can be circumvented by allowing the MoveSdk to stay active all the time. In that case the SDK is always monitoring required data and is therefore consuming more battery. Depending on the configuration, it may happen that the notification (see) is always visible to the user.
Gets the current.
Get the current .
Get the current .
Get the current list of .
Get the current list of .
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
or handle errors if occurred.
Block that gets invoked every time is changed and provides the updated .
Provide a block to be invoked every time changes.
Block that gets invoked every time is updated.
The host app is expected to monitor updates viaauthStateUpdateListene
API and handle those changes accordingly.
Check for more details about authentication expiry and renewal.
Provide a block to be invoked every time changes.
Block that gets invoked every time is changed and provides the updated .
Provide a block to be invoked every time changes.
Provide a block to be invoked every time changes.
Stops SDK services, send the queued user data, and de-initializes the SDK. After that is executed, the will transit to .uninitialized
.
If it's necessary just to stop all SDK services you most likely need to use instead of shutdown. Use shutdown in case of user's logout, SDK auth error (in those cases where you know for sure that you will need to execute with new object, for example).
If true, shutdown executes immediately. Pending Data may be lost and always returns with a success, see otherwise.
New feature in MOVE SDK 2.x; configuration in MOVE dashboard pending - please .
Returns a promise with a .
Usual setTimeout doesn't work if app is in the background on Android. The SDK provides setTimer that works in the same way as setTimeout, but also in the background. A call to setTimer
returns a “timer identifier” that we can use to cancel the execution via .
This method removes timer that was added via .
After a shutdown(...)
( / ) the Tag is also cleared.
Updates SDK . On SDK auth expiry, the authStateListener will trigger expired state. The host app is expected to fetch a new using its project API key and pass it to the MoveSDK using the following API:
Change the originally passed in setup. Optionally update the passed in setup.
Block that gets invoked every time a new is detected.
Set a connection state listener to be fired when the Bluetooth connection state of a previously registered has changed.
listener ->
A callback returning the which connection state was changed.
Get a list of devices () registered to be discovered during trips.
Register devices () to be discovered during trips.
Subscribe to updates for registered devices scanned during trips. See .
Provide a block to be invoked every time MoveHealthScorewill change.
Provide a block to be invoked every time was successfully fetched from the server.