onIDVServerBiometricAuthenticationResult
Event: onIDVServerBiometricAuthenticationResult
š Overview
onIDVServerBiometricAuthenticationResult is an event triggered by the REL-ID SDK after the selfie biometric authentication process is completed. It returns the status of the authentication by comparing the captured selfie with the stored biometric template on the server.
š§ Purpose
This event communicates the result of the authentication attempt and helps the app take action based on the outcome.
š„ Trigger Source
Triggered after calling:
initiateIDVServerBiometricAuthentication();šØ Payload Structure
{
"status": "SUCCESS" | "FAILED",
"errorCode": 0,
"message": "Authentication successful"
}š Payload Fields
| Field | Type | Description |
|---|---|---|
status | string | Indicates the outcome of the authentication: SUCCESS or FAILED |
errorCode | int | Numeric code indicating error cause if any (0 for success) |
message | string | Description of the authentication result |
ā Error Code Reference
| Error Code | Description | Action |
|---|---|---|
| 0 | Authentication successful | Proceed |
| 101 | No biometric template found | Prompt biometric opt-in |
| 201 | Poor selfie image quality | Retry selfie capture |
| 301 | Authentication match failed | Retry or use fallback auth |
ā
On Success
- Allow user to proceed with secured operation or screen
ā On Failure
- Inform the user
- Provide retry option or fallback (e.g., password login)
Code Snippets for Handling onIDVServerBiometricAuthenticationResult
onIDVServerBiometricAuthenticationResultReact Native
eventEmitter.on('onIDVServerBiometricAuthenticationResult', (result) => {
if (result.status === 'SUCCESS') {
// Navigate to secure screen
} else {
console.warn('Authentication failed:', result.message);
// Show retry/fallback
}
});Flutter
rdna.onIDVServerBiometricAuthenticationResult((result) {
if (result['status'] == 'SUCCESS') {
// Proceed with secure access
} else {
print('Failed: ${result['message']}');
// Offer retry or alternate auth
}
});Cordova
document.addEventListener('onIDVServerBiometricAuthenticationResult', function(result) {
if (result.status === 'SUCCESS') {
// Authentication success
} else {
console.error('Auth failed:', result.message);
// Handle retry or fallback
}
});Native Android
@Override
public void onIDVServerBiometricAuthenticationResult(JSONObject result) {
String status = result.optString("status");
if ("SUCCESS".equals(status)) {
// Continue secure flow
} else {
Log.e("BiometricAuth", "Failed: " + result.optString("message"));
// Show error UI
}
}Native iOS (Objective-C)
- (void)onIDVServerBiometricAuthenticationResult:(NSDictionary *)result {
NSString *status = result[@"status"];
if ([status isEqualToString:@"SUCCESS"]) {
// Proceed to secured screen
} else {
NSLog(@"Authentication failed: %@", result[@"message"]);
// Provide retry or fallback option
}
}Updated 9 months ago
