Set CDCVM method
Last updated
Was this helpful?
Was this helpful?
DigitalizedCardManager.getAllCards( new AbstractAsyncHandler<String[]> () {
@Override
public void onComplete(final AsyncResult<String[]> asyncResult) {
if (asyncResult.isSuccessful()) {
// Card list retrieved successfully
}
else {
// Card list retrieval failed
final int errorCode = asyncResult.getErrorCode();
if (errorCode == DigitalizedCardErrorCodes.CD_CVM_REQUIRED) {
// Set the CDCVM method here (see next section)
// ....
}
}
}
});// Check device eligibility for CDCVM
DeviceCVMEligibilityResult result =
DeviceCVMEligibilityChecker.checkDeviceEligibility(getApplicationContext());
if (result.getBiometricsSupport() == BiometricsSupport.SUPPORTED) {
// Biometric is supported
try {
DeviceCVMManager.INSTANCE.initialize(CHVerificationMethod.BIOMETRICS);
} catch (DeviceCVMException e) {
// Handle error
}
}
else if (result.getDeviceKeyguardSupport() == DeviceKeyguardSupport.SUPPORTED) {
// If biometrics are not supported, use device keyguard.
try {
DeviceCVMManager.INSTANCE.initialize(CHVerificationMethod.DEVICE_KEYGUARD);
} catch (DeviceCVMException e) {
// Handle error
}
}
else {
// Device does not support CDCVM, or the end user did not enable a secure lock screen.
// Prompt the end user to enable biometrics or device credentials.
}