React Native version v4.0.0
Overview
This release performs two main changes:
- Provide support for React Native's new architecture
- 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 aResult
with either a value, or an error, instead ofPromise<string>
. The value is aUXComponentsStatus
, 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 anerror
inside. Instead, it now returns aResult
with eithererror
orvalue
, withvalue
being the dictionary of tokens.- KYC Events:
onKycSdkTerminate
event now returns a boolean underverification
rather than astring
representing theboolean
underVarification
.onKycFailed
returns a dictionary witherror
, rather than an array where the description is in the second item.
Additions
setAppCheckToken
is added
Deprecations
Result
will still contain aresult
with the same value contained invalue
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 thanany
.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 aResult
that contains either a value or an error. Before it was returning the same, but it was announced asPromise<any>
.matchComponents
becomesPromise<boolean>
, rather thanPromise<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 ononGetTag
, 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 thevalue
key of the dictionary. The SDK kept the oldresult
value for backwards compatibility, but it's marked as deprecated and will eventually be deleted.startChallenge
now returnsPromise<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 astring
undersuccessTermination
rather than underSuccess Termination
to make it more JS friendly. The previous approach is still available but will be deprecated.onKycCompleteFailed
now returns the error inerror
, as well as undermessage
for backwards compatibility.message
is deprecated.- Added
onKycEvent
to notify about step initiated, completed and applicant loaded in itsvalue
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:
- As a pre-requisite to biometrics enrolment, to authenticate the user for the first time
- 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.