getIDVSelfieConfirmation

šŸ”„ Event: getIDVSelfieConfirmation

šŸ“˜ Description

This event is triggered by the Ditto ID SDK module to confirm the match result between the document photo and the captured selfie before continuing the activation or KYC workflow.

šŸŽÆ Purpose

This event prompts the app to:

  • Display the captured selfie
  • Show the user portrait from document
  • Present the match score and display text
  • Ask for user consent to proceed or retry

šŸ§‘ā€šŸ’» Platform Support

React Native
EventEmitter.addListener('getIDVSelfieConfirmation', getIDVSelfieConfirmation);
Flutter
rdna.on(RdnaClient.getIDVSelfieConfirmation, getIDVSelfieConfirmation);
Cordova
document.addEventListener('getIDVSelfieConfirmation', getIDVSelfieConfirmation, false);
Native iOS
(void)getIDVSelfieConfirmation:(RDNAChallengeOpMode)mode workflow:(RDNAIDVWorkflow)workflow;
Native Android
void getIDVSelfieConfirmation(int challengeMode, RDNA.RDNAIDVWorkflow workflow);

šŸ“¤ Response Format (String based)

{
  "challengeMode":8,
  "response_data":ā€<<The response_data contains the Selfie Confirmation JSON v3.0>>ā€
}

Selfie Confirmation JSON v3.0

{
  "response_data": {
    "analyze_liveness_response": {
      "video": {
        "autocapture_result": {
          "selfie_image": "<Base64 Image>"
        },
        "liveness_result": {
          "score": 100
        }
      }
    },
    "face_matcher_response": {
      "score": 4.674335479736328
    },
    "biometric_result": {
      "display_text": "MATCHED",
      "result_criteria": "Greater than or equal to 1.6"
    },
    "document_detail": {
      "document_info": {
        "name": "testUser",
        "age": "28",
        "portrait_image": "<<base 64 String>>"
      }
    }
  },
  "action_buttons": {
    "success_button": [
      {
        "key": "continue-flow",
        "button_text": "Continue"
      }
    ],
    "failure_button": [
      {
        "key": "continue-flow",
        "button_text": "Continue Anyway"
      },
      {
        "key": "reinit-idv-document-scan",
        "button_text": "Rescan Document"
      },
      {
        "key": "reinit-idv-selfie",
        "button_text": "Recapture Selfie"
      }
    ]
  }
}

šŸ“¦ Selfie Confirmation JSON v3.0 Details

šŸ“„ Click to expand

šŸ”ø analyze_liveness_response

video.autocapture_result.selfie_image₹

  • šŸ“ø Base64-encoded selfie image captured during liveness check.
  • šŸ‘‰ Display to user for confirmation.

video.liveness_result.score

  • šŸ”¢ Score indicating how likely the selfie is a live person.
  • āœ… Higher is better (e.g., out of 100).

šŸ”ø face_matcher_response

score

  • šŸ”¢ Raw facial match score between selfie and document portrait.
  • šŸ” Lower or higher scores may be better based on the algorithm.

šŸ”ø biometric_result

display_text

  • 🧾 Describes match result like "MATCHED" or "NOT MATCHED".
  • šŸ‘‰ Display to the user as match summary.

result_criteria

  • šŸ“Œ Explains the rule used to determine a match (e.g., ā€œ>= 1.6ā€).

šŸ”ø document_detail.document_info

name

  • šŸ‘¤ Name extracted from the document.

age

  • šŸŽ‚ Age of the user based on document DOB.

portrait_image

  • šŸ–¼ļø Base64-encoded image of the document's photo.
  • šŸ‘‰ Display for visual side-by-side comparison with selfie.

šŸ”ø action_buttons

āœ… success_button[]

Actions for when the user confirms the match.

  • key: Internal action ID (e.g., continue-flow)
  • button_text: Text to display on confirmation button

šŸ” failure_button[]

Actions for when the user rejects the result.

  • key: One of continue-flow, reinit-idv-document-scan, reinit-idv-selfie
  • button_text: Corresponding text for UI button

🧠 Developer Tips

UI ElementJSON Field
Selfie Imageselfie_image
Document Portraitportrait_image
Match Scorescore
Match Summarydisplay_text
Action Buttonsaction_buttons.success_button[], failure_button[]

🧠 Notes for Developers

  • The app must read response_data.biometric_result.display_text to determine whether to auto-confirm or ask for consent.
  • Use the action_buttons.success_button and failure_button to render confirmation or retry options.
  • All images (like selfie_image, portrait_image) are in base64 format and should be rendered inline in the UI.
  • The match score is optional UI indicators and not mandatory for flow control.

🧭 Example User Flow

flowchart TD
    A[SDK triggers getIDVSelfieConfirmation] --> B[App displays selfie, document image, score]
    B --> C{User choice}
    C -->|āœ… Confirm| D[App calls setIDVSelfieConfirmation("continue-flow", challengeMode)]
    C -->|šŸ” Retake| E[App calls setIDVSelfieConfirmation("reinit-idv-selfie", challengeMode)]

šŸ› ļø Response API: setIDVSelfieConfirmation

Description:

Used by the application to confirm or reject the captured selfie based on user input.


Parameters:

ParameterTypeDescription
actionStringOne of the predefined keys from action_buttons JSON
challengeModeIntegerMode received from getIDVSelfieConfirmation event

🧠 Action Keys & Their Significance

Action KeyDescription
continue-flowDitto ID SDK will proceed to the next configured event in the workflow
reinit-idv-document-scanSDK will trigger getIDVDocumentScanProcessStartConfirmation again
reinit-idv-selfieSDK will restart selfie capture flow
šŸ”§

Developers must pass one of the above keys as action in setIDVSelfieConfirmation.


šŸ’» API Usage

React Native
RdnaClient.setIDVSelfieConfirmation(true, workflow, challengeMode, (response) => {
  // handle RDNAError
});
Flutter
rdna.setIDVSelfieConfirmation(true, workflow, challengeMode);
Cordova
com.uniken.rdnaplugin.RdnaClient.setIDVSelfieConfirmation(
  successCallback,
  errorCallback,
  [true, workflow, challengeMode]
);
Native iOS
(RDNAError *)setIDVSelfieConfirmation:(BOOL)isConfirmed
                              workflow:(RDNAIDVWorkflow)workflow
                        challengeMode:(RDNAChallengeOpMode)mode;
Native Android
RDNA.RDNAError setIDVSelfieConfirmation(boolean isConfirmed,
                                        RDNA.RDNAIDVWorkflow workflow,
                                        int challengeMode);

āš ļø Error Codes

CodeDescriptionDeveloper Action
146Selfie not confirmedPrompt for retake or fallback
400Invalid input or stateRetry with valid values

āœ… Notes

  • Confirmation is a mandatory step after selfie capture
  • Failure to call this API will stall the IDV workflow