Android Native
This is integration guide document for Android platform as a part of eKYC service provided by FinOS Technology VN.
Document version : v1.0.0
SDK version : v4
SDK Setup
Prerequisite
Add config to gradle on project level
maven {
url = 's3://finos.mvnrepository-dev'
credentials(AwsCredentials) {
accessKey = AWS_ACCESS_KEY_ID
secretKey = AWS_SECRET_ACCESS_KEY
}
}
- AWS_ACCESS_KEY_ID , AWS_SECRET_ACCESS_KEY : FinOS will provide
NOTE
- In case android studio latest version, put config above in dependencyResolutionManagement on settings.gradle
- In case android studio version < Chipmunk version, put config above in allprojects on build.gradle
Init SDK
FinOSNetworkSDK.initialize(config: Map<String, Any>)
FinOSNetworkSDK.initialize(config: Map<String, Any>)
With config:
val config = mutableMapOf<String, Any>()
config["environment"] = FinOsEnv.SANDBOX
config["timeout"]= 30
Use OCR Feature
Add OCR lib to gradle
implementation(group: 'android.ekyc_v4', name: 'finos_network', version: "1.0.15.trunk_noSSL", ext: 'aar') { transitive = true}
implementation(group: 'android.ekyc_v4', name: 'finos_ocr', version: "1.0.15.trunk_noSSL", ext: 'aar'){ transitive = true}
Call function OCR from SDK
FinOSDocCaptureConfigs(this).apply {
setDocCaptureAPIHeaders(mapOf("X-FinOS-Api-Key" to "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"))
setShouldShowInstructionScreen(true)
setDocumentType(FinOSDocCaptureConfigs.DocumentType.CARD)
setDocumentSide(FinOSDocCaptureConfigs.DocumentSide.FRONT)
... [Ref to Table of Func Customization]
startOCR { response ->
// handle response here
}}
Table Of Func Customization
| Screen Name | Func | Description | Note |
|---|---|---|---|
| Capture Doc Screen | fun setDocumentType(documentType: FinOSEkycDocumentType) | Define type of document to extract data | |
| fun setDocumentSide(documentSide: FinOSEkycDocumentSide) | Set side of document to extract data | ||
| fun setDocCaptureAPIHeaders(Map? headers) | Add headers paramters to API | [X-FinOS-Api-Key] is param for authorization | |
| fun setDocCaptureAPIParams(Map? params) | Set parameters in payload of API | ||
| fun setShouldShowFlashIcon(shouldShowFlashIcon: Boolean) | Allow showing flash icon | Data type : Boolean (Default : false) | |
| fun setDocCaptureButtonFlashTintColor(color: String) | Set color of button flash | Default : #0091F2 | |
| fun setDocCaptureAppBarColor(color: String) | Set color if app bar | ||
| fun setDocCaptureTitle(title: String) | Set text title | Default is ID Front Side/ID Back Side it’s depends on document type | |
| fun setDocCaptureTitleTextColor(color: String) | Set text color of title | Default : #ffffffff | |
| fun setDocCaptureTitleTextSize(size: float) | Set font size of text title | Default is style TextViewHeader 20f | |
| fun setDocCaptureDescription(description: String) | Set text of description | Default : Please place the front side of ID card in the center/Please place the back side of ID card in the center | |
| fun setDocCaptureDescriptionTextColor(color: String) | Set text color of description | Default : #ffffffff | |
| fun setDocCaptureDescriptionTextSize(size: float) | Set font size of text description | Default is style TextViewSubtitle 17f | |
| fun setDocCaptureButtonCaptureTintColor(color: String) | Set color of button capture | Default : #ffffffff | |
| fun setDocCaptureButtonSwitchCameraTintColor(color: String) | Set color of button switch camera | Default : #ffffffff | |
| fun setShouldShowSwitchCameraButton(enable: Boolean) | Allow showing switch camera button | Default : false | |
| fun setDocCaptureCameraSide(cameraSide: CameraSide) | Set camera side Front/Back | Default : Back | |
| fun setShouldShowReviewScreen(shouldShowReviewScreen: Boolean) | Allow showing review screen | Default : false | |
| fun setShouldShowInstructionScreen(shouldShowInstructionScreen: Boolean) | Allow showing instruction screen | Default : false | |
| fun start(callback: Callback) | Start OCR document (open capture doc screen) | ||
| fun setImageCompressRatio(ratio: Float) | Set compress ratio for image before sending to server | Range 0 -> 1 (Default 0.5) | |
| Review Screen | fun setDocReviewButtonBackTintColor(color: String) | ||
| fun setDocReviewAppBarColor(color: String) | |||
| fun setDocReviewTitle(title: String) | Set text for title of screen | Default : Review Your Document | |
| fun setDocReviewTitleTextColor(color: String) | Set color for text title | Default : #000000 | |
| fun setDocReviewTitleTextSize(size: float) | Set font size of text title | Default : 20f | |
| fun setDocReviewDescription(description: String) | Set text for description | Default : Make sure the lighting is good and letters are clearly visible. | |
| fun setDocReviewDescriptionTextColor(color: String) | Set color for text description | Default : #000000 | |
| fun setDocReviewDescriptionTextSize(size: float) | Set font size for text description | Default : 17f | |
| fun setDocReviewButtonRetake(text: String) | Set text for button retake | Default : Retake | |
| fun setDocReviewButtonRetakeColor(color: String) | Set border of button retake | Default : #0091F2 | |
| fun setDocReviewButtonRetakeTextColor(color: String) | Set text color of button retake | Default : #0091F2 | |
| fun setDocReviewButtonRetakeTextSize(size: float) | Set font size text of button retake | Default : 20f | |
| fun setDocReviewButtonContinue(text: String) | Set text of button continue | Default : Continue | |
| fun setDocReviewButtonContinueColor(color: String | Set color of button continue | Default : #0091F2 | |
| fun setDocReviewButtonContinueTextColor(color: String) | Set text color of button continue | Default : #ffffffff | |
| fun setDocReviewButtonContinueTextSize(size: float) | Set font size text of button continue | Default : 20f | |
| Loading screen | fun setDocLoadingButtonBackTintColor(color: String) | Set color of button back | Default: #000000 |
| fun setDocLoadingTitle(text: String) | Set text title | Default : Uploading your photos | |
| fun setDocLoadingTitleTextColor(color: String) | Set text color for title | Default :#000000 | |
| fun setDocLoadingTitleTextSize(size: float) | Set font size text for title | Default : 20f | |
| fun setDocLoadingDescription(text: String) | Set text of description | Default : This may take a few seconds, please wait | |
| fun setDocLoadingDescriptionTextColor(color: String) | Set text color of description | Default : #000000 | |
| fun setDocLoadingDescriptionTextSize(size: float) | Set font size text of description | Default : 17f | |
| fun setCustomLoading(view: View) | Set a customize view of loading | Android is fragment | |
| Instruction Screen | fun setDocInstructionButtonBackTintColor(color: String) | Set color for button back | Default: #000000 |
| fun setDocInstructionAppBarColor(color: String) | |||
| fun setDocInstructionTitle(title: String) | Set text title | Default: ID Capture Tips | |
| fun setDocInstructionTitleTextColor(color: String) | Set text color for title | Default : #000000 | |
| fun setDocInstructionTitleTextSize(size: float) | Set font size for text title | Default: 20f | |
| fun setDocInstructionButtonContinue(text: String) | Set text of button continue | Default : Process | |
| fun setDocInstructionButtonContinueColor(color: String) | Set color of button continue | Default : #0091F2 | |
| fun setDocInstructionButtonContinueTextColor(color: String) | Set text color of button continue | Default : #ffffffff | |
| fun setDocInstructionButtonContinueTextSize(size: float) | Set font size text of button continue | Default : 20f | |
| fun setCustomInstruction(view: View) | Change content of instruction |
Use Face Comparison Feature
Add lib to gradle
implementation(group: 'android.ekyc_v4', name: 'finos_network', version: "1.0.15.trunk_noSSL", ext: 'aar') { transitive = true
implementation(group: 'android.ekyc_v4', name: 'finos_liveness', version: "1.0.15.trunk_noSSL", ext: 'aar'){ transitive = true}
Call function Face Compare from SDK
NetworkHelper.makeFaceMatchCall(
faceUri: String,
documentUri: String,
parameters: Map<String, String>?,
headers: Map<String, String?>,
result: ((response: Map<String, Any>?) -> Unit)? = null
)
Parameters
| Param | Type | Description |
|---|---|---|
| faceUri | String | URI of face image |
| documentUri | String | URI of document image |
| parameters | Map<String, String?> | Parameter of Payload |
| headers | Map<String, String?> | Parameter of header. Supported : X-FinOS-Api-Key (Authorization key provided by FinOS) - transactionId (unique value, presentative of transaction eKYC) |
Example
NetworkHelper.makeFaceMatchCall(
faceUri!!,
documentUri!!,
null,
mapOf("X-FinOS-Api-Key" to "c84294ba-793d-4592-b844-1d59b9e52ba1", "transactionId" to "AWNF63M9201LAQNA")
) { data ->
//handle response here
}
Use Liveness Check Feature
Add lib to gradle
implementation(group: 'android.ekyc_v4', name: 'finos_network', version: "1.0.15.trunk_noSSL", ext: 'aar') { transitive = true
implementation(group: 'android.ekyc_v4', name: 'finos_liveness', version: "1.0.15.trunk_noSSL", ext: 'aar'){ transitive = true}
Call function Liveness Check from SDK
val faceConfigModel = FinOSFaceCaptureConfigs(this.applicationContext)
.apply {
setFaceCaptureAPIHeaders(mapOf("X-FinOS-Api-Key" to "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"))
setLivenessMode(FinOSEkycLivenessMode.ACTIVE)
... [Ref to Table of Func Customization]
}
faceConfigModel.start { response ->
//handle response here
}
Table Of Func Customization
| Screen Name | Func | Description | Note |
|---|---|---|---|
| Face Detect Screen | fun setFaceCaptureButtonBackTintColor(color: String) | Set color of button back | Default: #FFFFFF |
| fun setLivenessMode(livenessMode: FinOSEkycLivenessMode) | Supported 2 mode : Active (Require user actions to detect liveness) - Passive (capture selfie and send to server process detection) | ||
| fun setFaceCaptureAPIHeaders(Map? headers) | Add headers paramters to API | [X-FinOS-Api-Key] is param for authorization | |
| fun setFaceCaptureAPIParams(Map? params) | Set parameters in payload of API | ||
| fun setFaceCaptureAppBarColor(color: String) | Set color of app bar | Default : #242828 | |
| fun setFaceCaptureTitle(title: String) | Set text title | Default: Face Detection | |
| fun setFaceCaptureTitleTextColor(color: String) | Set text color of title | Default: #FFFFFF | |
| fun setFaceCaptureTitleTextSize(size: float) | Set font size of text title | Default: 20f | |
| fun setFaceCaptureProgressTrackColor(color: String) | Set color of progress track | Default: #FFFFFF | |
| fun setFaceCaptureProgressIndicatorColor(color: String) | Set color of progress indicator | Default: #E7332D | |
| fun setFaceCaptureActionStraight(text: String) | Set text of action look straight | Default: Look straight | |
| fun setFaceCaptureActionSmile(text: String) | Set text of action smile | Default: Smile! | |
| fun setFaceCaptureActionLeft(text: String) | Set text of action turn left | Default: Turn left | |
| fun setFaceCaptureActionRight(text: String) | Set text of action turn right | Default: Turn right | |
| fun setFaceCaptureActionUp(text: String) | Set text of action head up | Default: Head up | |
| fun setFaceCaptureActionDown(text: String) | Set text of action head down | Default: Head down | |
| fun setFaceCaptureActionFaceInCenter(text: String) | Set text guide move face in the center of circle | Default: Please move your face in the center of the frame | |
| fun setFaceCaptureActionCaptureNow(text: String) | Set text of capture action | Default: Capture Now | |
| fun setFaceCaptureActionTextColor(color: String) | Set text color of capture action | Default: #FFFFFF | |
| fun setFaceCaptureActionTextSize(size: float) | Set font size of text capture action | Default: 17f | |
| fun setFaceCaptureButtonCaptureTintColor(color: String) | Set color of button capture | Default: #0091F2 | |
| fun setFaceCaptureButtonSwitchCameraTintColor(color: String) | Set color of button switch camera | Default: #FFFFFF | |
| fun setShouldShowSwitchCameraButton(enable: Boolean) | Allow showing button switch camera | Default : false | |
| fun setFaceCaptureCameraSide(cameraSide: CameraSide) | Set uses camera back or front camera | Default : front | |
| fun setShouldShowReviewScreen(shouldShowReviewScreen: Boolean) | Allow showing review screen | Default : false | |
| fun setShouldShowInstructionScreen(shouldShowInstructionScreen: Boolean) | Allow showing instruction screen | Default : false | |
| fun setImageCompressRatio(ratio: Float) | Set image compress ratio range 0…1 | Default : 0.5 | |
| Review Screen | fun setFaceCaptureReviewButtonBackTintColor(color: String) | Set color of button back | Default: #000000 |
| fun setFaceCaptureReviewAppBarColor(color: String) | Set color of app bar | Default: #FFFFFF | |
| fun setFaceCaptureReviewTitle(title: String) | Set text title | Default : Review | |
| fun setFaceCaptureReviewTitleTextColor(color: String) | Set text color of text title | Default: #000000 | |
| fun setFaceCaptureReviewTitleTextSize(size: float) | Set font size of text title | Default 20 | |
| fun setFaceCaptureReviewDescription(text: String) | Set text of description | Default : “” | |
| fun setFaceCaptureReviewDescriptionTextColor(color: String) | Set text color of description | Default : #000000 | |
| fun setFaceCaptureReviewDescriptionTextSize(size: float) | Set font size of description | Default: 17 | |
| fun setFaceCaptureReviewButtonRetake(text: String) | Set text of button retake | Default: Retake | |
| fun setFaceCaptureReviewButtonRetakeColor(color: String) | Set color of button retake | Default: #FFFFFF | |
| fun setFaceCaptureReviewButtonRetakeTextColor(color: String) | Set text color of button retake | Default : #000000 | |
| fun setFaceCaptureReviewButtonRetakeTextSize(size: float) | Set font size of text button retake | Default 17 | |
| fun setFaceCaptureReviewButtonContinue(text: String) | Set text of button continue | Default : Continue | |
| fun setFaceCaptureReviewButtonContinueColor(color: String) | Set color of button continue | Default : #0091F2 | |
| fun setFaceCaptureReviewButtonContinueTextColor(color: String) | Set text color of button continue | Default: #FFFFFF | |
| fun setFaceCaptureReviewButtonContinueTextSize(size: float) | Set font size of text button continue | Default: 17 | |
| Loading Screen | fun setFaceLoadingButtonBackTintColor(color: String) | Set color of button back | Default: #000000 |
| fun setFaceLoadingTitle(text: String) | Set text title | Default : Face Loading | |
| fun setFaceLoadingTitleTextColor(color: String) | Set text color of title | Default : #000000 | |
| fun setFaceLoadingTitleTextSize(size: float) | Set font size of title | Default : 17 | |
| fun setFaceLoadingDescription(text: String) | Set text of description | Default : Face Loading Desc | |
| fun setFaceLoadingDescriptionTextColor(color: String) | Set text color of description | Default : #000000 | |
| fun setFaceLoadingDescriptionTextSize(size: float) | Set font size of text description | Default : 17 | |
| fun setCustomLoading(view: View) | Set customize loading | Android is fragment | |
| fun setFaceInstructionAppBarColor(color: String) | Set color of app bar | Default: #FFFFFF | |
| fun setFaceInstructionTitle(text: String) | Set text of title | Default: Face Recognition | |
| fun setFaceInstructionTitleTextColor(color: String) | Set text color of title | Default: #000000 | |
| fun setFaceInstructionTitleTextSize(size: float) | Set font size of text title | Default: 20 | |
| fun setFaceInstructionButtonContinue(text: String) | Set text of button continue | Default: Process | |
| fun setFaceInstructionButtonContinueColor(color: String) | Set color of button continue | Default: #0091F2 | |
| fun setFaceInstructionButtonContinueTextColor(color: String) | Set text color of button continue | Default: #FFFFFF | |
| fun setFaceInstructionButtonContinueTextSize(size: float) | Set font size of text button continue | Default: 17 | |
| fun setCustomInstruction(view: View) | Change content of instruction | ||
| fun setFaceInstructionButtonBackTintColor(color: String) | Set color of button back | Default: #000000 | |
| fun start(callback: Callback) | start face capture |
