Skip to content

Upgrade Guide

Miquel edited this page Oct 27, 2023 · 10 revisions

Upgrading to v4.0

Changes to Options

In order to match the changes from the latest native SDKs, the options related to the faceDetector are no longer available. This includes the faceDetector option, and those related to the pose maxPitch, maxYaw and maxRaw.

Cancelling the SDK

The method iProov.cancel() can be used to cancel an ongoing claim without canceling the subscription to the Stream<IProovEvent> returned by IProov.

final stream = IProov.launch(streamingUrl: '< YOUR STREAMING URL', token: '< YOUR TOKEN >');

iProov.cancel();

The enum IProov.Canceller has now been renamed following U.S. English naming conventions to IProov.Canceler

Exceptions

The UserTimeout exception has been added to IProovException. This exception is only reported on iOS.

Upgrading to v3.0

Cancelling the SDK

An ongoing claim can be cancelled by cancelling the subscription to the Stream<IProovEvent> returned by IProov.

final stream = IProov.launch(streamingUrl: '< YOUR STREAMING URL', token: '< YOUR TOKEN >');

final subscription = stream.listen((event) {
  ...
});

subscription.cancel();

Changes to Options

New structure

With the latest release of the native SDK for iOS and Android, a new UX/UI is provided. Options has been restructured accordingly, so some options have been renamed and others have been removed.

Old API:

const options = Options(
    ui: UiOptions(
        title: 'Example',
        floatingPromptEnabled: true,
        genuinePresenceAssurance: GenuinePresenceAssuranceUiOptions(
            autoStartDisabled: true,
            notReadyTintColor: Colors.grey,
            readyTintColor: Colors.green,
            progressBarColor: Colors.blue)));

New API:

const options = Options(
      filter: NaturalFilter(style: NaturalFilterStyle.clear),
      title: 'Example',
      titleTextColor: Colors.black,
      promptTextColor: Colors.red,
      promptRoundedCorners: true,
      promptBackgroundColor: Colors.lightBlue,
      surroundColor: Colors.grey,
      genuinePresenceAssurance: GenuinePresenceAssuranceOptions(
          readyOvalStrokeColor: Colors.purple,
          notReadyOvalStrokeColor: Colors.brown
      ),
      livenessAssurance: LivenessAssuranceOptions(
          ovalStrokeColor: Colors.purple,
          completedOvalStrokeColor: Colors.white
      ));

For more information on the new Options, check the documentation here.

Streaming URL

The SDK now streams over WebSockets instead of Socket.IO. In practice, this means that you should replace any references to https://*.rp.secure.iproov.me with wss://*.rp.secure.iproov.me/ws when passing the streamingURL parameter to IProov.launch().

Further guidance will be forthcoming in due course for any customers making use of reverse proxies. In the meantime, please contact us to discuss your requirements further.

Upgrading to v2.0

Migrate from callback to Stream<IProovEvent>

The iProov SDK now returns a Stream<IProovEvent> instead of having a Function(IProovEvent) callback.

This means you can now use iProov more idiomatically from Dart, with better integration into the Dart/Flutter ecosystem, enabling, for example, direct usage with StreamBuilder.

Old API:

IProov.launch(streamingUrl: '< YOUR STREAMING URL', token: '< YOUR TOKEN >', callback: (event) {
  ...
});

New API:

final stream = IProov.launch(streamingUrl: '< YOUR STREAMING URL', token: '< YOUR TOKEN >');

stream.listen((event) {
  ...
});

Changes to Options

New structure

Options are now built via const constructors rather than setting properties on a mutable object.

Old API:

final options = Options();
options.ui.title = 'Example';
options.ui.floatingPromptEnabled = true;
options.ui.genuinePresenceAssurance.autoStartDisabled = true;
options.ui.genuinePresenceAssurance.notReadyTintColor = Colors.grey;
options.ui.genuinePresenceAssurance.readyTintColor = Colors.green;
options.ui.genuinePresenceAssurance.progressBarColor = Colors.blue;

New API:

const options = Options(
    ui: UiOptions(
        title: 'Example',
        floatingPromptEnabled: true,
        genuinePresenceAssurance: GenuinePresenceAssuranceUiOptions(
            autoStartDisabled: true,
            notReadyTintColor: Colors.grey,
            readyTintColor: Colors.green,
            progressBarColor: Colors.blue)));

NetworkOptions.certificates

The type of NetworkOptions.certificates (previously defined as Options.network.certificates) has been changed from List<Int> to List<Uint8List>.

Rename IProovEventProgress to IProovEventProcessing

IProovEventProgress is now renamed to IProovEventProcessing to better align with our other SDKs. Its properties and behavior remain unchanged.

Old API:

if (event is IProovEventProgress) {
  final progress = event.progress;
  final message = event.message;
}

New API:

if (event is IProovEventProcessing) {
  final progress = event.progress;
  final message = event.message;
}

Dart API Client

For convenience, the Dart API client is now unbundled from the Example app and is available as a separate package, iproov_api_client.

There are also some minor API changes to improve ergonomics and readability.

Old API:

final apiClient = APIClient(baseUrl, apiKey, secret);

New API:

final apiClient = const APIClient(baseUrl: baseUrl, apiKey: apiKey, secret: secret);

New SDK UI options

There are various new UI options which have been added in the latest versions of the iOS & Android SDKs that are now available for use from Flutter.

Consult the CHANGELOG for further details.