Initialization
API Interface / Flutter
The MOVE SDK must be initialized natively. For the first init, the SDK expects to be setup after user onboarding using Flutter. In this case, Flutter passes the required auth code or MoveAuth, and MoveConfig objects.
In all future inits, the SDK expects to be initialized natively at app start points (MainApplication for Android). This is to guarantee that the MOVE SDK is set up and active before the limited time provided by the OS in background wakeups is consumed.
The native init will re-use the last authentication and configs objects passed to the SDK from the Flutter initialization.
Setup MOVE SDK
With MoveAuth
To setup the MOVE SDK with a registered user you have to provide MoveAuth, MoveConfig:
Parameters
auth
moveConfig
options
Will be remove in future versions, use setupWithCode(...)
instead.
With authCode
Alternative to the approach with the MoveAuth you can setup the MOVE SDK with an authentication string. This authCode must be fetched from the backend using the userId (see MOVE Backend - Example request).
Parameters
authCode
moveConfig
options
Returns
Android
To initialize the SDK natively, in your MainApplication:
For iOS the SDK is automatically initialized in the FlutterPlugin
lifecycle during didFinishLaunchingWithOptions.
Notification
To use the MoveSdk in the background, it is required to configure the trip or als recognition notification, like shown in the following:
Make sure that you are also creating a notification channel. More information about notifications can be found at Notification Management.
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 must be initialized.
Parameters
Default
force
true
If true, shutdown
executes immediately. Pending Data may be lost.
Returns
Configuration services
Update authentication
Updates SDK MoveAuth. The host app was expected to fetch a new MoveAuth using its project API key and pass it to the MoveSDK using the following API:
Deprecated: Token expiry is no longer a valid auth state forwarded to the app and does not need to be handled.
Update configuration
Updates SDK MoveConfig.
config
The new MoveConfig to use.
Throws
uninitialized
The SDK is in uninitialized
state.
Last updated