-
Notifications
You must be signed in to change notification settings - Fork 5
Upgrading to v10.x
There have been a number of breaking changes in this 10.0.0 release. Please read through this section to understand those changes and refer to the revised README.md.
With v10.x, the API is now inside the package com.iproov.sdk.api
(instead of com.iproov.sdk
). This will require changes to import statements.
With v10.x, the new method of starting an iProov scan is to first create a Session
and then call .start()
on it.
Note that .start()
may only be called once (even if it fails) otherwise a new exception SessionCannotBeStartedTwiceException
will be thrown immediately.
This means that IProovFlowLauncher
and IProovCallbackLauncher
have been removed.
The Callback mechanism had been kept in previous major versions to ease the transition to StateFlows. Callbacks are inherently dangerous in these situations in the Android world and can lead to memory leaks.
Now the only way to listen to the states of IProov and to gain the result is to collect from Session.state: StateFlow<IProov.State>
as follows:
val session = IProov.createSession(context, baseUrl, token, options)
launch {
session.state.collect { state ->
//TODO Action on State
}
}
session.start()
IProov.State
has a new initial state called IProov.State.Starting
, which comes before IProov.State.Connecting
.
"IProov" has been removed from many classes and interfaced within IProov
itself to avoid unnecessary duplication.
e.g. IProov.IProovSessionState
is now IProov.SessionState