iOS Components v3.4.0
· 2 min read
Improves the public interface of the biometrics enrollment flow, and minor fixes.
Added
- Added
startEnrollment(viewController:completion:)to improve the result reporting of enrollment flow viaBiometricsEnrollmentResult. - Added
credentialstoWeavrSecureLoginData.
Changed
- Surfaced HTTP 401 errors in
startEnrollment(vc:token:completion:)by providing anErrorResponsewith a401code. This code should be handled by triggering a new login, and setting the token on the SDK again viaUXComponents. - Improved wording on alerts displayed during the start of the enrollment flow.
Fixed
- Fixed scenarios where
SecureCardNumberLabelfails to detokenise without reporting an error.
Deprecated
- Deprecated
startEnrollment(vc:token:completion:)in favour ofstartEnrollment(viewController:completion:).
Migration guide
To adopt the new startEnrollment method you just need to take the following actions:
- Ensure you have provided a fresh token to
UXComponents.setUserToken(token:) - Update your calling site to a snippet similar to the following:
UXComponents.psa.startEnrollment(viewController: viewController) { res in
switch res {
case .completed:
print("The enrollment was completed successfully")
case .initialisationError(error: let error):
print("There was an error while initialising the enrollment flow: \(error)")
case .cryptographyError(error: let error):
print("There was an error in the cryptography operations of the enrollment flow: \(error)")
case .failedBiometricsChallenge:
print("The user failed the biometrics challenge")
case .unauthorized:
print("The token present in the SDK is not valid")
case .userDoesNotConsent:
print("The user cancelled the flow")
case .failedToLoadBrand:
print("Failed to load the brand configuration.")
case .noPhoneNumberAvailable:
print("No phone number available to perform the SMS OTP flow.")
case .noBiometricsAvailable(hardwareSupportsBiometrics: let hardwareSupportsBiometrics):
print("No biometrics available. Hardware supports biometrics: \(hardwareSupportsBiometrics)")
case .challengeFailed(cause: let cause):
print("The challenge failed due to \(cause)")
}
}