Skip to main content
Version: 3.7.x.x RR

Introduction and essentials

The core SDK scenarios with backend interactions are covered by operations for registration, authentication and deregistration. Additional operations not necessarily involving backend communications are covered in the other operations chapter.

tip

We recommend reading the lifecycle section for the registration and authentication operations to get a grasp of the operation sequence and required implementations.

Operations in Flutter and React Native plugins

The Flutter and React Native plugins use operation caches to synchronise operations and their callbacks between the native and cross-platform layers.

Do not retain operation objects

It is very important to be aware of this fact because, as a consequence, operation objects cannot be re-used, as they are removed after their lifecycle ended. Retaining and re-using operation objects in the cross-platform plugins will lead to crashes.

Here is a "bad example" of retaining the OutOfBandAuthentication object to explain operation object reuse. This example is of course valid for all operations and although shown in React Native also applies to Flutter:

Bad object re-use example
let auth: OutOfBandAuthentication; //the problem starts here

client?.operations.outOfBandOperation
...
.onAuthentication(async (authentication) => {
if (auth === undefined) {
auth = authentication; // this is the problematic part; you are not always using the new authentication object, that is provided by the SDK plugin but assiging a "stale" already used object
}
await auth.accountSelector(..) //it will cause problems here as not the `authentication` object is used but the potentially stale `auth` object
.authenticatorSelector(..)
.pinUserVerifier(..)
.biometricUserVerifier(..)
.onSuccess(...)
.onError(...)
.execute()
.catch(...);
})
.onError(...)
.execute()
.catch(...);

Refer to our example apps for guidance of the correct usage of our SDK.