KTP Scan

Flow Version - v1.2

Setup Sdk

Launch Flow

let config = DigitalIdentityKTPScanConfig(
    baseUrl: <DigitalIdentity BE Base Url>,
    token: <DigitalIdentity Token>,
    correlationId: <Coorrelation Id>,
    language: <App Language>,
    theme: <KTP Scan flow theme>
)

DigitalIdentitySdk.shared.launchKTPScan(
    config: config,
    viewcontroller: <viewcontroller instance>
) { result in
    // Completion handler
}

Method name: launchKTPScan

Parameters:

  • config: Instance of DigitalIdentityKTPScanConfig
    • baseUrl: DigitalIdentity BE URL received from the DigitalIdentity team.
    • token: DigitalIdentity token received from the DigitalIdentity authentication API.
    • correlationId: Unique identifier for the KTP Scan flow.
    • language: App language.
    • theme: The optional DigitalIdentityKTPScanFlowTheme class instance parameter allows for theme customization of the KTP Scan flows screen. Detailed information can be found in the theme customization section.
  • viewcontroller: An instance of the view controller used to display the KTP Scan flow screens.
  • completion: KTP Scan flow completion status block. In completion, you will get an instance of the DigitalIdentityDocumentVerificationResult class. It has the following properties:
    • correlationId: Correlation Id value which was passed in the launchKTPScan method call.
    • status: KTP Scan flow completion status. Its DigitalIdentityDocumentVerificationResultStatus enum type and has the following values:
      • completed: KTP Scan is done.
      • error: Error in KTP Scan verification.
      • notCompleted: User dropped from KTP Scan flow screens.
    • submissionId: Optional value. A reference number associated with the KTP Scan documents.
    • extra: Optional value and type of DigitalIdentityResultExtraData class. Sdk will send this property when the user drops from the flow. It has the following properties
      • errorCode: It's a DigitalIdentityFlowErrorCode enum type and it has following values
        • CAMERA - User dropped the flow from the camera error bottom sheet
        • PERMISSION - User denied camera permission
        • NETWORK - User dropped the flow from the api error bottom sheet
        • USER_CANCELLED - User dismissed the flow
        • VERIFICATION - Document verification has been completed with errors
      • errorMessage: More details about the error

Theming Reference

The following screens can be customized using the SDK’s theming system.

KTP Onboarding

Class name: DigitalIdentityOnboardingScreenTheme

Screen Annotations

Mapped Properties

  1. background
  2. backButton
  3. card
  4. title
  5. subtitle
  6. ktpInstructionImage
  7. otherInstructions
    7.1. background
    7.2. icon
    7.3 description
  8. footerView
  9. termsInfo
  10. captureButton

KTP Camera

Class name: DigitalIdentityKTPCameraScreenTheme

Screen Annotations

Mapped Properties

  1. background
  2. backButton
  3. viewGuide
  4. title
  5. captureIndicatorViewColor: While tapping the Capture button in manual capture mode, a fraction of a second camera screen background color will updated to a different color to indicate the image captured. To customize this color we can use this property
  6. feedback
    6.1. background
    6.2. neutral/error/success & feedbacks
  7. changeCaptureMode
    7.1. closeButton
    7.2. card
    7.3. title
    7.4. description
    7.5. primaryCTA
    7.6. secondaryCTA
  8. shutterButton

KTP Guideline

Class name: DigitalIdentityGuidelineScreenTheme

Screen Annotations

Mapped Properties

  1. background
  2. closeButton
  3. guideline.autoCaptureTitle /
    guideline.manualCaptureTitle
  4. guideline.autoCaptureInfoView
  5. guideline.autoCaptureInfoTitle
  6. guideline.autoCaptureInfoDescription
  7. guideline.allowedCard
  8. guideline.allowedCardTitle
  9. guideline.notAllowedCard
  10. guideline.notAllowedCardTitle
  11. guideline.autoCaptureInstructions
    / guideline.manualCaptureInstructions
  12. guideline.bulletPoint

KTP Verification & KTP Verification Time Exceed

Class name: DigitalIdentityDocumentVerificationScreenTheme

Screen Annotations

Mapped Properties

  1. background
  2. containerCard
  3. backButton
  4. inprogressTitle
  5. verificationTimer
  6. timeExceedTitle
  7. timeExceedImage

Common Dialogs



Documentations