Class Digified

java.lang.Object
io.digified.digified_library.digified.Digified

public class Digified extends Object
  • Method Details

    • getInstance

      public static Digified getInstance(android.content.Context context, String baseUrl, String apiKey)
      creating Digified object
      Parameters:
      context - context
      baseUrl - https url of the backend hosting Digified API
      apiKey - API Key of the Digified API
      Returns:
      an instance of Digified Object
    • updateApiKey

      public void updateApiKey(String newApiKey)
      updating the API key, usually this will be used to verify another document or use case
      Parameters:
      newApiKey - New API Key of the Digified API
    • setMaxDimensions

      public void setMaxDimensions(int maxWidth, int maxHeight)
      Setting the max dimensions of images not to be exceeded after cropping the image (the exact size of the cropped image can't be set to avoid stretching the image)
      Parameters:
      maxWidth - maximum width of the output image
      maxHeight - maximum height of the output image
    • setCaptureTimeout

      public void setCaptureTimeout(int captureTimeoutMillis)
      Setting the capture time out, this controls when will CaptureCallback.onTimeout() is called
      Parameters:
      captureTimeoutMillis - time out in milli seconds
    • enableManualCapturingFallback

      public void enableManualCapturingFallback()
      Enables fallback to manual capturing after CaptureCallback.onTimeout() happens if capturing is using ML models, it is disabled by default. (time out can be set from setCaptureTimeout(int)
    • getFinalStatus

      public int getFinalStatus()
      Use this method to get the final status of the verification process, the final status will be on of those statuses DigifiedConstants.Status
      Returns:
      final status of the verification process
    • getNextAction

      public int getNextAction()
      Use this method to get the next action that you should let the user perform based on the predefined sequence in the SDK. Actions can be found here DigifiedConstants.Action
      Returns:
      the next action to be performed (the us should let the user performs)
    • resetSequence

      public void resetSequence()
      rests the SDK to the initial stats
    • initialize

      public void initialize(@Nullable String warningAction, @Nullable String userName, @Nullable String phoneNumber, @Nullable String email, @NonNull InitializeCallback callback)
      Performs the init request of the API
      Parameters:
      warningAction - setting the warning action for the api (optional - set to null if you will not use it)
      userName - name of the user (optional - set to if you will not use it)
      phoneNumber - user's phone number (optional - set to null if you will not use it)
      email - user's email (optional - set to null if you will not use it)
      callback - callback interface to let you know the status of the request
    • initialize

      public void initialize(InitializeCallback callback)
      Performs the init request of the API if use this method, then the following fields be set as follows:

      phoneNumber, userName, email are going to be set to null

      warningAction is going to be set to report DigifiedConstants.WarningAction.REPORT

      Parameters:
      callback - callback interface to let you know the status of the request
    • capture

      public void capture(androidx.fragment.app.FragmentManager fragmentManager, int containerId, int captureType, CaptureCallback captureCallback)
      This method is used to capture images (ID front image, ID back image and Selfie)
      Parameters:
      fragmentManager - FragmentManager that will handle the display of the fragments of the SDK
      containerId - Resource Id of the view that will be replaced with the capturing fragment
      captureType - Specifies what you are capturing (ID Front, ID Back or Selfie) find the types here DigifiedConstants.CaptureType
      captureCallback - interface that will let you deal with the capture request
    • capture

      public void capture(androidx.fragment.app.FragmentManager fragmentManager, int containerId, int captureType, int desiredWidth, int desiredHeight, CaptureCallback captureCallback)
      This method is used to capture images (ID front image, ID back image and Selfie)
      Parameters:
      fragmentManager - FragmentManager that will handle the display of the fragments of the SDK
      containerId - Resource Id of the view that will be replaced with the capturing fragment
      captureType - Specifies what you are capturing (ID Front, ID Back or Selfie) find the types here DigifiedConstants.CaptureType
      desiredWidth - required image width (not guaranteed in order not to stretch the image, however SDK will not exceed that width)
      desiredHeight - required image height (not guaranteed in order not to stretch the image, however SDK will not exceed that height)
      captureCallback - interface that will let you deal with the capture request
    • capture

      public void capture(androidx.fragment.app.FragmentManager fragmentManager, int containerId, int captureType, CaptureScreenMetaData captureScreenMetaData, CaptureCallback captureCallback)
      This method is used to capture images (ID front image, ID back image and Selfie)
      Parameters:
      fragmentManager - FragmentManager that will handle the display of the fragments of the SDK
      containerId - Resource Id of the view that will be replaced with the capturing fragment
      captureType - Specifies what you are capturing (ID Front, ID Back or Selfie) find the types here DigifiedConstants.CaptureType
      captureScreenMetaData - CaptureScreenMetaData that will be displayed while capturing
      captureCallback - interface that will let you deal with the capture request
    • capture

      public void capture(androidx.fragment.app.FragmentManager fragmentManager, int containerId, int captureType, int desiredWidth, int desiredHeight, CaptureScreenMetaData captureScreenMetaData, CaptureCallback captureCallback)
      This method is used to capture images (ID front image, ID back image and Selfie)
      Parameters:
      fragmentManager - FragmentManager that will handle the display of the fragments of the SDK
      containerId - Resource Id of the view that will be replaced with the capturing fragment
      captureType - Specifies what you are capturing (ID Front, ID Back or Selfie) find the types here DigifiedConstants.CaptureType
      desiredWidth - required image width (not guaranteed in order not to stretch the image, however SDK will not exceed that width)
      desiredHeight - required image height (not guaranteed in order not to stretch the image, however SDK will not exceed that height)
      captureScreenMetaData - CaptureScreenMetaData that will be displayed while capturing
      captureCallback - interface that will let you deal with the capture request
    • cancelCapture

      public void cancelCapture()
      cancelling the capture request (usually will be used if capture timeout passed and you want to allow the user to cancel the capturing request)
    • send

      public void send(CaptureResult captureResult, IdExtractionCallback idExtractionCallback)
      Sending the captured image of ID front and back (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after calling capture(FragmentManager, int, int, CaptureCallback) or capture(FragmentManager, int, int, int, int, CaptureCallback)
      Parameters:
      captureResult - CaptureResult object containing the ID Front or ID Back image
      idExtractionCallback - callback interface containing the result of the API call
    • send

      public void send(CaptureResult captureResult, VehicleLicenseExtractionCallback vehicleLicenseExtractionCallback)
      Sending the captured image of Vehicle License front and back (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after calling capture(FragmentManager, int, int, CaptureCallback) or capture(FragmentManager, int, int, int, int, CaptureCallback)
      Parameters:
      captureResult - CaptureResult object containing the ID Front or ID Back image
      vehicleLicenseExtractionCallback - interface containing the result of the API call
    • send

      public void send(CaptureResult captureResult, FaceMatchCallback faceMatchCallback)
      Sending the captured selfie image (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after calling capture(FragmentManager, int, int, CaptureCallback) or capture(FragmentManager, int, int, int, int, CaptureCallback)
      Parameters:
      captureResult - CaptureResult object containing the Selfie image
      faceMatchCallback - callback interface containing the result of the API call
    • send

      public void send(CaptureResult captureResult, PassportExtractionCallback passportExtractionCallback)
      Sending the captured passport image (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after calling capture(FragmentManager, int, int, CaptureCallback) or capture(FragmentManager, int, int, int, int, CaptureCallback)
      Parameters:
      captureResult - CaptureResult object containing the Selfie image
      passportExtractionCallback - callback interface containing the result of the API call
    • send

      public void send(CaptureResult captureResult, GenericIdExtractionCallback genericIdExtractionCallback)
      Sending the captured image of a generic ID front and back (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after calling capture(FragmentManager, int, int, CaptureCallback) or capture(FragmentManager, int, int, int, int, CaptureCallback)
      Parameters:
      captureResult - CaptureResult object containing the ID Front or ID Back image
      genericIdExtractionCallback - callback interface containing the result of the API call
    • transliterate

      public void transliterate(TransliterationCallback transliterationCallback)
      Getting the transliteration of the arabic name in the document scanned
      Parameters:
      transliterationCallback - callback interface containing the result of the API call
    • shouldAuthorize

      public void shouldAuthorize(String token, androidx.fragment.app.FragmentManager fragmentManager, int containerId, DigifiedAuthorizationCallback authorizationCallback)
      This methods helps you to decide if the user is authorized to do some critical actions on your app by checking if the current user made a successful verification before, by: 1- Getting the verification result by the provided token 2- Taking a new selfie of the user and match the selfie image with the verified selfie image from the old verified result
      Parameters:
      token - biometric token from older request
      fragmentManager - FragmentManager that will handle the display of the fragments of the SDK
      containerId - Resource Id of the view that will be replaced with the capturing fragment
      authorizationCallback - callback interface containing the result of the authorization process
    • shouldAuthorize

      public void shouldAuthorize(String token, androidx.fragment.app.FragmentManager fragmentManager, int containerId, CaptureScreenMetaData captureScreenMetaData, DigifiedAuthorizationCallback authorizationCallback)
      This methods helps you to decide if the user is authorized to do some critical actions on your app by checking if the current user made a successful verification before, by: 1- Getting the verification result by the provided token 2- Taking a new selfie of the user and match the selfie image with the verified selfie image from the old verified result
      Parameters:
      token - biometric token from older request
      fragmentManager - FragmentManager that will handle the display of the fragments of the SDK
      containerId - Resource Id of the view that will be replaced with the capturing fragment
      captureScreenMetaData - CaptureScreenMetaData that will be displayed while capturing
      authorizationCallback - callback interface containing the result of the authorization process