Live demo of agent247 on Digio's docs — click the orange button at the bottom right to start.

IOS KYC SDK

DigiokycSDK

How to Integrate?

  • On terminal, cd to your Xcode project root directory (where your .xcodeproj file)
    1. pod init -> This will create a podfile.
    2. Add the following line to your podfile
    3. pod 'DigiokycSDK'
      • pod 'DigioCaptureKit' (Optional for selfie)
    4. pod install
    5. Close all session of xcode projects and open your project again.

Create SDK configuration

1. Import the Digio module

import DigiokycSDK

2. Configure Digio instance

  do {
    try DigioKycBuilder()
          .withController(viewController: self) // Mandatory pass your view controller here
          .setEnvironment(environment: .SANDBOX) // Mandatory: SANDBOX / PRODUCTION
          .setDocumentId(documentId: "DID**") // Mandatory Unique MandateId /Document ID
          .setIdentifier(identifier: "email/phone") // Mandatory identifier
          .setKycResponseDelegate(delegate: self) // Optional delegate
          .setFontFormat(fontFormat: "")
          .setFontFamily(fontFamily: "")
          .setFontUrl(fontUrl: "")
          .setTokenId(tokenId: "GWT**") // Optional:- token id to bypass first factor authentication
          .setLogo(logo: "") //optional your logo link
          .setAdditionalParams(additionalParams: [:]) //Optional:- Additional Params
          .build()
  } catch {
      print("Exception --> \(error.localizedDescription)")
  }

3. Handle SDK response

  • Implement DigioKycResponseDelegate, add onDigioKycResponseSuccess, onDigioGatewayEvent & onDigioKycResponseFailure protocol stubs
  extension YourViewController : DigioKycResponseDelegate {
      func onDigioKycResponseSuccess(successResponse: String) {
          print("Success \(successResponse)")
       }

      func onDigioKycResponseFailure(failureResponse: String) {
          print("Failure \(failureResponse)")
      }
      func onGatewayEvent(event: String) {
          print("DigioGatewayEvent \(event)")
      }
  }

4. Permissions need to add in your info.plist

  /**  Camera permission incase of selfie/video KYC/ capture document  **/
  <key>NSCameraUsageDescription</key>
  <string>$(PRODUCT_NAME) would like to access your camera.</string>
  <key>NSPhotoLibraryUsageDescription</key>
  <string>$(PRODUCT_NAME) would like to access your photo.</string>

  /**  Microphone permission incase of video KYC  **/
  <key>NSMicrophoneUsageDescription</key>
  <string>$(PRODUCT_NAME) would like to access your microphone to capture video.</string>

  /** Location permission for geo tagging for camera/video kyc/ selfie **/
  <key>NSLocationWhenInUseUsageDescription</key>
  <string>$(PRODUCT_NAME) would like to access your location.</string>
  <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
  <string>$(PRODUCT_NAME) would like to access your location.</string>

Note : All permissions should be checked and taken before triggering Digio SDK

  • GatewayEventResponse
  {
    "txnId": "2.5601690357804383",
    "documentId": "KID230303132625594XWVBSZBSZO7ZXS",
    "event": "kyc.initiated",
    "identifier": "email@domain.com",
    "entity": "kyc"
  }
  • Sample Response
    {
      "status": "success",
      "id": "KID230406115342351F7MJ4I2KISPA6O",
      "code": 1001,
      "message": "KYC Process Completed."
    }
    {
      "status": "failure",
      "id": "KID230406115342351F7MJ4I2KISPA6O",
      "errorCode": 1002,
      "code": 1002,
      "message": "failure message based on the case"
    }
    {
      "message": "Cancelled By User",
      "code": -1000,
      "id": "KID230406115342351F7MJ4I2KISPA6O",
      "status": "cancel"
    }
  • Cancel case
  • Failure case
  • Success case

Version Details below

  • Platform = ios
  • Ios.deployment_target = 15.6
  • Swift_version = 5.7.2
  • Xcode_version = 16.2

Possible Error Codes and Reason

code/errorCodeDescription
1001Success
1002Kyc Process Failed
-1000Cancelled By User
1008Location/Camera/MicroPhone Permission Denied By User
10017WebView Error

Additional error code with reason(In case of Offline Kyc)

code/errorCodeDescription
1005You have exceed OTP attempts
10012Aadhaar number does not have mobile number
10014UIDAI Exceeded Maximum OTP generation Limit. Try after sometime
10015
  • Technical Exception from UIDAI
  • Technical error please try again
  • 10016UIDAI server error. Please try again in some time.
    10018UIDAI technical issue please try after some time
    10019UIDAI could not be loaded please try after some time.

    Was this page helpful?