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
      • 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
  • Detection Services
  • Start Automatic Detection
  • Stop Automatic Detection
  • Force Trip Recognition
  • Manual Start Trip
  • Finish Current Trip
  • Ignore Current Trip
  • Processing Services
  • Keep in foreground (Android only)
  • Keep active (Android only)
  • Get SDK State
  • Get Trip State
  • Get Auth State
  • Set SDK State Listener
  • Set SDK Auth State Listener
  • Set Trip State Listener
  • Set Errors Listener
  • Set Warnings Listener
  • Resolve Error
  • Synchronize User Data
  • Other Services
  • Live Location TAG
  • Initiate Assistance Call
  • Set Assistance MetaData
  • Geocode
  • Set Remote Config Change Listener
  • Device Discovery
  • Scanning Devices
  • Set MoveDevice Connection State Listener
  • Get Registered Devices
  • Register Devices
  • Unregister Devices
  • Discover Devices
  • Helath Listener
  1. MOVE SDK
  2. API Interface
  3. Flutter

Services

API Interface / Flutter

PreviousInitializationNextModels

Last updated 2 months ago

import 'package:movesdk/movesdk.dart';

Detection Services

Start Automatic Detection

Starts the required detection services stated in the passed on initialization. Starting the service will set the to .running.

Returns false if the SDK is not in .ready state.

Future<bool> MoveSdk.startAutomaticDetection()

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 back to .ready.

Returns false if the SDK is not in .ready state.

Future<bool> MoveSdk.stopAutomaticDetection()

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.

Future<void> MoveSdk.forceTripRecognition()

Manual Start Trip

Future<bool> startTrip(Map<String, String>? metadata)

Returns false if the SDK is not in .ready state.

Finish Current Trip

Ends the current ongoing trip.

Future<void> MoveSdk.finishCurrentTrip()

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 ignoreCurrentTripAPI.

Ignore Current Trip

Ignores the current ongoing trip.

Future<void> MoveSdk.ignoreCurrentTrip()

Processing Services

Keep in foreground (Android only)

When an Android application is in the background it may receive limited data (location, sensors, etc.). To improve this behavior, 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.

Disabled by default. Since it may be annoying to the user, it should only be enabled in case of problems.

Future<void> MoveSdk.keepInForeground(bool enabled)

Keep active (Android only)

Disabled by default. Since this is consuming more battery, it should only be enabled in case of problems.

Future<void> MoveSdk.keepActive(bool enabled)

Get SDK State

Future<MoveState> getState() async

Get Trip State

Future<MoveTripState> getAuthState() async

Get Auth State

Future<MoveAuthState> getAuthState() async

Set SDK State Listener

Stream<MoveState> setSdkStateListener() async*

Set SDK Auth State Listener

Stream<MoveAuthState> setAuthStateListener() async*

Authentication Expiry

Set Trip State Listener

Stream<MoveTripState> setTripStateListener() async*

Set Errors Listener

Stream<List<MoveServiceError>> setServiceErrorListener() async*

Set Warnings Listener

Stream<List<MoveServiceWarning>> setServiceWarningListener() async*

Resolve Error

Forces a permission recheck, useful for example after the motion permission request was given in iOS.

Future<void> resolveError()

Synchronize User Data

Used to force synchronizing user data with the SDK server. Limited to once per 2 minutes.

Future<bool> synchronizeUserData()

Returns wether data upload is still in progress.

Other Services

Live Location TAG

New feature since MOVE SDK 2.8.0

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.

Future<bool> setLiveLocationTag(String? tag)

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 Assistance Call

Initiate an assistance call to emergency services.

Future<MoveAssistanceCallStatus> initiateAssistanceCall()

Precondition: The assistance call service needs to be configured in the MOVE dashboard. The SDK needs to be in ready or running state.

Set Assistance MetaData

Future<void> setAssistanceMetaData(String? assistanceMetadataValue)

Parameters

data

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.

Geocode

Geo-code address lookup.

Geocode will use the system's native Geocode API or fallback to contacting the MOVE backend to attempt a geo-lookup.

Future<GeocodeResult> geocode(double latitude, double longitude) async

Parameters

latitude

double

GPS location latitude.

longitude

double

GPS location longitude.

class MoveGeocodeResult {
  String? result;
  MoveGeocodeError? error;
}

Throttle: Geocode is limited to a maximum of 100 lookups per hour.

The native API may have its own throttling and maybe used up for the app calling this function.

Set Remote Config Change Listener

Since MOVE SDK v2.5

Stream<MoveConfig> setRemoteConfigChangeListener() async*

Parameters

listener

Device Discovery

Scanning Devices

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.

Stream<List<MoveDevice>> startScanningDevices(
      {List<MoveDeviceFilter> filter = const [MoveDeviceFilter.paired],
      String? uuid,
      int? manufacturerId}) async*
Parameters

filter

MoveDeviceFilter

Filter devices by type. See bellow.

uuid

string

UUID String required to scan beacons.

manufacturerId

int

Manufacturer ID needed to scan beacons.

Opens a stream which will receive a list of new unique devices scanned. Device scanning will be stopped when the stream is closed.

A list of filters can be specified to filter which devices to scan for:

MoveDeviceFilter

paired

Scan for paired devices. Default

connected

Show the connected devices.

beacon

Scan for beacon devices. uuid and manufacturerId required.

Set MoveDevice Connection State Listener

Since MOVE SDK v2.10.0

Stream<List<MoveDevice>> setDeviceStateListener() async*

Parameters

Get Registered Devices

Future<List<MoveDevice>> getRegisteredDevices() async

Register Devices

Future<void> registerDevices(List<MoveDevice> devices) async

Unregister Devices

Future<void> unregisterDevices(List<MoveDevice> devices) async

Discover Devices

Stream<List<MoveScanResult>> setDeviceDiscoveryListener() async*

Helath Listener

Opens a stream to receive updates when values of MoveHealthItems changed. See MoveHealtItem (iOS) / MoveHealthScore (Android).

Stream<List<MoveHealthItem>> setHealthListener() async*

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 backgroundLocationPermissionMandatorywith 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 .

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.

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 .

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.readyor handle errors if occurred.

Provide a block to be invoked every time 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.

Provide a block to be invoked every time changes.

Provide a block to be invoked every time changes.

Provide a block to be invoked every time changes.

After a the tag is also cleared.

New feature in MOVE SDK 2.x; configuration in MOVE dashboard pending - please .

Returns a promise with a .

Returns an object of type MoveGeocodeResult with either the Address as a result string, or a .

Provide a block to be invoked every time was successfully fetched from the server.

A callback returning a object after a successful server fetch.

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.

Unregister devices () to be discovered during trips.

Opens a stream to receive updates when devices are scanned for during trips. See .

MoveConfig
MoveSDKState
MoveSDKState
MoveTripState
MoveTripState
MoveTripState
MoveTripState
MoveTripState
notification handling
MoveSDKState
MoveTripState
MoveAuthState
MoveSDKState
MoveSDKState
State
MoveSDKState
MoveAuthState
MoveAuthState
MoveTripState
MoveServiceFailure
MoveServiceWarning
get in touch
MoveGeocodeError
finishCurrentTrip()
MoveOptions
MoveSdkState
MoveAssistanceCallStatus
shutdown(...)
Authentication updates and expiry
timeline
MoveDevice
MoveDevice
MoveDevice
MoveDevice
MoveDevice
MoveDevice
MoveDeviceStateListener
MoveConfig
MoveConfig
MoveScanResult