Setup
Before services can be started a user object must be setup to use the SDK and a services configuration must be provided.
Setup Auth/Config
Authenticates a user to be used with the SDK.
func setup(auth: MoveAuth, config: MoveConfig)
Update Config
Change the config originally passed in setup.
func update(config: MoveConfig)
Parameters
Occasionally this functionality is needed for deployed apps when a projects configuration is updated on the backend.
Precondition: SDK user/config should be setup.
Update authentication
Updates SDK MoveAuth. On SDK auth expiry, the auth state listener will trigger expired state. The host app is expected to fetch a new MoveAuth using its project API key and pass it to the MoveSDK using the following API:
func update(auth: MoveAuth, completion: ((MoveAuthError?) -> Void)? = nil)
Parameter
auth
The user's updated MoveAuth object with the new token.
Callback
completion
Block that gets invoked on auth update completion with an optional MoveAuthError for potential updating errors.
Precondition: SDK user/config should be setup.
Get SDK Auth State
Gets the current MoveAuthState.
func getAuthState() -> MoveAuthState
Return
Latest SDK State
Set SDK Auth State Listener
Provide a block to be invoked every time MoveAuthState changes.
func setAuthStateUpdateListener(_ listener: AuthStateCallback)
Callback
Block that gets invoked every time MoveAuthState is updated.
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.
Set SDK Initialization Listener
Provide a block to be invoked when configuration fetch failed.
func setInitializationListener(_ listener: MoveInitializationCallback)
Callback
MoveInitializationCallback
Block that gets invoked every time configuration fetch from the server failed.
Shutdown
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
.
func shutDown(force: Bool, _ callback: ((MoveShutdownResult) -> Void)?)
Parameters
Default
force
true
If true, shutdown executes immediately. Pending Data may be lost.
Precondition: SDK user/config should be setup.
Last updated