Class Digified
java.lang.Object
io.digified.digified_library.digified.Digified
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelling the capture request (usually will be used if capture timeout passed and you want to allow the user to cancel the capturing request)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)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)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)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)void
Enables fallback to manual capturing afterCaptureCallback.onTimeout()
happens if capturing is using ML models, it is disabled by default.int
Use this method to get the final status of the verification process, the final status will be on of those statusesDigifiedConstants.Status
static Digified
getInstance
(android.content.Context context, String baseUrl, String apiKey) creating Digified objectint
Use this method to get the next action that you should let the user perform based on the predefined sequence in the SDK.void
initialize
(InitializeCallback callback) Performs the init request of the API if use this method, then the following fields be set as follows:void
initialize
(String warningAction, String userName, String phoneNumber, String email, InitializeCallback callback) Performs the init request of the APIvoid
rests the SDK to the initial statsvoid
send
(CaptureResult captureResult, FaceMatchCallback faceMatchCallback) Sending the captured selfie image (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
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 callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
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 callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
void
send
(CaptureResult captureResult, PassportExtractionCallback passportExtractionCallback) Sending the captured passport image (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
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 callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
void
setCaptureTimeout
(int captureTimeoutMillis) Setting the capture time out, this controls when willCaptureCallback.onTimeout()
is calledvoid
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)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 resultvoid
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 resultvoid
transliterate
(TransliterationCallback transliterationCallback) Getting the transliteration of the arabic name in the document scannedvoid
updateApiKey
(String newApiKey) updating the API key, usually this will be used to verify another document or use case
-
Method Details
-
getInstance
creating Digified object- Parameters:
context
- contextbaseUrl
- https url of the backend hosting Digified APIapiKey
- API Key of the Digified API- Returns:
- an instance of Digified Object
-
updateApiKey
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 imagemaxHeight
- maximum height of the output image
-
setCaptureTimeout
public void setCaptureTimeout(int captureTimeoutMillis) Setting the capture time out, this controls when willCaptureCallback.onTimeout()
is called- Parameters:
captureTimeoutMillis
- time out in milli seconds
-
enableManualCapturingFallback
public void enableManualCapturingFallback()Enables fallback to manual capturing afterCaptureCallback.onTimeout()
happens if capturing is using ML models, it is disabled by default. (time out can be set fromsetCaptureTimeout(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 statusesDigifiedConstants.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 hereDigifiedConstants.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
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 SDKcontainerId
- Resource Id of the view that will be replaced with the capturing fragmentcaptureType
- Specifies what you are capturing (ID Front, ID Back or Selfie) find the types hereDigifiedConstants.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 SDKcontainerId
- Resource Id of the view that will be replaced with the capturing fragmentcaptureType
- Specifies what you are capturing (ID Front, ID Back or Selfie) find the types hereDigifiedConstants.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 SDKcontainerId
- Resource Id of the view that will be replaced with the capturing fragmentcaptureType
- Specifies what you are capturing (ID Front, ID Back or Selfie) find the types hereDigifiedConstants.CaptureType
captureScreenMetaData
-CaptureScreenMetaData
that will be displayed while capturingcaptureCallback
- 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 SDKcontainerId
- Resource Id of the view that will be replaced with the capturing fragmentcaptureType
- Specifies what you are capturing (ID Front, ID Back or Selfie) find the types hereDigifiedConstants.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 capturingcaptureCallback
- 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
Sending the captured image of ID front and back (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
- Parameters:
captureResult
- CaptureResult object containing the ID Front or ID Back imageidExtractionCallback
- 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 callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
- Parameters:
captureResult
- CaptureResult object containing the ID Front or ID Back imagevehicleLicenseExtractionCallback
- interface containing the result of the API call
-
send
Sending the captured selfie image (encapsulated in CaptureResult object) to the API CaptureResult will be obtained after callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
- Parameters:
captureResult
- CaptureResult object containing the Selfie imagefaceMatchCallback
- 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 callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
- Parameters:
captureResult
- CaptureResult object containing the Selfie imagepassportExtractionCallback
- 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 callingcapture(FragmentManager, int, int, CaptureCallback)
orcapture(FragmentManager, int, int, int, int, CaptureCallback)
- Parameters:
captureResult
- CaptureResult object containing the ID Front or ID Back imagegenericIdExtractionCallback
- callback interface containing the result of the API call
-
transliterate
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 requestfragmentManager
- FragmentManager that will handle the display of the fragments of the SDKcontainerId
- Resource Id of the view that will be replaced with the capturing fragmentauthorizationCallback
- 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 requestfragmentManager
- FragmentManager that will handle the display of the fragments of the SDKcontainerId
- Resource Id of the view that will be replaced with the capturing fragmentcaptureScreenMetaData
-CaptureScreenMetaData
that will be displayed while capturingauthorizationCallback
- callback interface containing the result of the authorization process
-