-
Notifications
You must be signed in to change notification settings - Fork 5
Upgrading to v6.x
⚠️ This document relates to deprecated or obsolete SDK versions. For details regarding upgrading to the latest SDK version, consult the main Upgrade Guide.
The IProov.launch()
methods have been improved in three important ways.
- Old deprecated
launch()
methods from v5.0 have been removed. These ones took alistener: Listener
parameter. You can no longer use them. If you hadn't already updated please look below in Upgrading to v5.1.0 and to Upgrading to v6.0 Multiple Listener callbacks - Of the remaining three
launch()
methods from v5.1 onwards, these have been reduced to two since thestreamingUrl: String
parameter is now mandatory. -
launch()
methods can now throw a subset ofIProovException
(namelyListenerNotRegisteredException
,MultiWindowUnsupportedException
,CaptureAlreadyActiveException
), under conditions known to prevent an IProov capture from starting at all. Therefore these methods now require exception handling (perhaps atry {} catch {}
).
The use of launch()
calls might look like this:
Kotlin
try {
IProov.launch(context, streamingUrl, token)
} catch (ex: IProovException) {
// Handle failure because of ListenerNotRegisteredException, MultiWindowUnsupportedException or CaptureAlreadyActiveException
}
try {
IProov.launch(context, streamingUrl, token, options)
} catch (ex: IProovException) {
// Handle failure because of ListenerNotRegisteredException, MultiWindowUnsupportedException or CaptureAlreadyActiveException
}
The IProov Android Biometric SDK has had some significant improvements made to it. Listed here are the breaking changes you need to know about.
The onSuccess()
and onFailure()
callbacks methods in IProov.Listener
have changed signature from multiple values to a single class.
In version 5.2.2, the signatures looked like this:
Kotlin
override fun onSuccess(token: String) {
// The user was successfully verified/enrolled and the token has been validated.
// The token passed back will be the same as the one passed in to the original call.
}
override fun onFailure(reason: String?, feedback: String?) {
// The user was not successfully verified/enrolled, as their identity could not be verified,
// or there was another issue with their verification/enrollment. A reason (as a string)
// is provided as to why the claim failed, along with a feedback code from the back-end.
}
In version 6.0+, the success and failure methods allow for further information to be passed, and to allow future extensibility, but aggregating values into a class. Also the token is now also passed in onFailure
.
You should be able to move from v5.2.2 to v 6.0.0 simply as follows:
Kotlin
override fun onSuccess(result: IProov.SuccessResult) {
// The user was successfully verified/enrolled and the token has been validated.
Log.i("Success", "Token: ${result.token}")
}
override fun onFailure(result: IProov.FailureResult) {
// The user was not successfully verified/enrolled, as their identity could not be verified,
// or there was another issue with their verification/enrollment.
Log.i("Failure", "Token: ${result.token}, reason: ${result.reason} feedbackCode: ${resule.feedbackCode}")
}
The previous IProov.unregisterListener();
was error prone and so it now expects to be passed a listener thus: IProov.unregisterListener(listener);
. This allows for multiple listeners to be registered and unregistered within their own scope without having any adverse effects of other code's listener(s).
Also IProov.registerListener(listener);
will no longer immediately replay the last event unless you use IProov.registerListener(listener, true);
v6.0 introduces connection callbacks, which means that the iProov UI is not displayed until the connection to iProov's servers has been established. This means that you can keep the user in your app and provide the appropriate UI until the connection has been established.
You must now implement new the onConnecting()
and onConnected()
statuses in the iProov listener.
If you do not wish to implement your own custom UI for connecting and revert to the legacy behavior from v5.2 and earlier, you can opt-out of this new feature by setting options.ui.useLegacyConnectingUI = true;
which will continue to show the connecting indication within the iProov SDK itself.
Please note that the useLegacyConnectingUI
option is deprecated, and will be removed in a future version of the SDK. All customers are advised to adopt the new connection callbacks as soon as possible.
Also be advised that options.ui.loadingTintColor
has also been deprecated, as this only takes effect when the legacy connecting UI is displayed.
v6.0 updates the SDK to AndroidX and thus apps using 6.0+ must support AndroidX and Target API Level 29+ (AndroidX is required for Target API Level 29+).
Play Console Target API Levels are described here. This states that Target API Level 29+ is required for new apps from Aug 3, 2020 and for app updates from Nov 2, 2020.
Migrating to AndroidX is described here.
To simplify things, the error StreamingException
has been renamed to NetworkException
, and the failures network_problem
and user_timeout
have been aggregated into it.
Since the FirebaseML face detector has been replaced by ML Kit, we have followed suit. This removes the dependency of registering with firebase to use this face detector, and in keeping we have renamed this library from iproov-firebase
to iproov-mlkit
.