Skip to main content

React Native version v4.0.0

· 5 min read

Overview

This release performs two main changes:

  1. Provide support for React Native's new architecture
  2. Leverage Expo modules API to simplify maintenance

With these changes in place, it is recommended to use this version of the SDK with the following versions in place:

  • React Native ~0.79
  • Expo ~53
  • React ~19

Expo modules

If you are working on a bare React Native app, you'll need to follow the instructions from Expo on how to add Expo modules in a bare React Native App.

Please notice that the automatic approach to add support relies on your native code to match the code generated by React Native 0.79. If you have files that are not updated properly, it will fail to patch them and will require your manual intervention.

Changes

Breaking changes

  • initializeUXComponents now returns a Result with either a value, or an error, instead of Promise<string>. The value is a UXComponentsStatus, matching the structure offered by the iOS SDK notifying of success, and whether the user needs to re-login after the upgrade.
  • createToken used to return a dictionary of values which may contain an error inside. Instead, it now returns a Result with either error or value, with value being the dictionary of tokens.
  • KYC Events:
    • onKycSdkTerminate event now returns a boolean under verification rather than a string representing the boolean under Varification.
    • onKycFailed returns a dictionary with error, rather than an array where the description is in the second item.

Additions

  • setAppCheckToken is added

Deprecations

  • Result will still contain a result with the same value contained in value for backwards compatibility, but this is deprecated and will be removed in the future.

Asynchronous calls that become synchronous

The SDK can turn some asynchronous functions into synchronous functions thanks to Expo modules.

If you were awaiting on these methods, the await call will behave in the same way it did in the past.

The following functions have been converted into synchronous:

  • isAssociated
  • resetAssociation, it also returns a boolean rather than any.
  • updateFCMToken
  • initializePSA
  • checkReadyForAuth
  • checkIsReadyForEnrollment
  • clearCache
  • getDeviceFingerPrint, and is also available in iOS.
  • getSDKVersion, and is also available in iOS.

Backwards compatible improvements

  • setUserToken now returns a Result that contains either a value or an error. Before it was returning the same, but it was announced as Promise<any>.
  • matchComponents becomes Promise<boolean>, rather than Promise<any>. No change in behaviour, just type.
  • The process to get tags to match components or create multiple tokens in one go is overhauled. In previous versions, you'd call getTag, await a callback on onGetTag, and then passing the value received to the relevant method. From now on, getTag is a Promise that returns a string with the value to use.
  • checkDeviceIsEnrolled returns the result in the value key of the dictionary. The SDK kept the old result value for backwards compatibility, but it's marked as deprecated and will eventually be deleted.
  • startChallenge now returns Promise<Result<WeavrChallengeResult, WeavrError>>. This is the same structure that was provided in the past, but the type is more re-usable within our SDK.
  • KYC Events:
    • onKycSdkTerminate event now returns a string under successTermination rather than under Success Termination to make it more JS friendly. The previous approach is still available but will be deprecated.
    • onKycCompleteFailed now returns the error in error, as well as under message for backwards compatibility. message is deprecated.
    • Added onKycEvent to notify about step initiated, completed and applicant loaded in its value property.

Additional functionality inherited from native components:

The Biometric Authentication component now supports the authentication of the end user via password rather than passcode. The password is used in two scenarios related to biometrics:

  1. As a pre-requisite to biometrics enrolment, to authenticate the user for the first time
  2. As a fall-back method of authenticating the user if biometrics fails (e.g. fingerprint not recognised)

1. Pre-requisites

Configure Weavr Authentication to "Password" in the embedder portal. If necessary, this can be applied for you in sandbox by Weavr support.

Integrate to the Password Component to authenticate the user for the first time; see password component documentation.

2. Fall-back authentication method

If during biometric login, biometrics fails (e.g. fingerprint not recognised), the SDK will automatically provide a screen for the user to authenticate via the alternative method of their password.