Mobile SDK Overview
FaceAuthen does not ship its own capture SDK. It reuses the CAKE eKYC Mobile SDK — the same takeFaces entry point that captures a selfie, checks its quality and confirms liveness. This page covers only the parts that matter for face authentication.
Platforms
| What | Description |
|---|---|
| Android | Kotlin. Entry point CakeEkyc. Current version 1.1.9. |
| iOS | Swift. Entry point CakeEkycSdk. Current version 1.1.9. |
| Flutter | Dart. Entry point CakeEkycPlugin. Current version 1.0.0. |
What the SDK Does For FaceAuthen
takeFaces runs a pipeline and hands you images that already passed quality and liveness:
capture faces → upload images → check face sanity → check livenessThat output feeds the two FaceAuthen calls your backend makes:
| What | Description |
|---|---|
| Register Faces | First enrolment. Pass the captured image IDs as faces. |
| Verify Face Authen | Every subsequent authentication. Pass the fresh selfie's image IDs. |
WARNING
The SDK never calls FaceAuthen. It captures and validates images, then stops. Registration, verification, duplicate handling and the profile lock are all your backend's responsibility — and the authentication_key that closes a transaction only comes from Verify Face Authen.
Common Configuration
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
baseUrl | string | Yes | — | Base URL for API requests. |
languageCode | string | No | vi | vi for Vietnamese, en for English. |
tokenProvider | TokenProvider | Yes | — | Supplies the authentication token. Called with timestamp, path and method. |
logger | Logger | No | — | Receives info, error and warning messages. |
WARNING
TokenProvider.getToken(timestamp, path, method) takes the method and path because the token is a per-request signature, not a static string. Never hardcode it — compute it on your backend. See Request Signing.
Capture Options
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
captureOnly | bool | No | false | Capture the image only — no upload, no quality check, no liveness. |
loadingView | View | No | SDK default | Replaces the loading UI shown during upload and checks. Android and iOS only. |
SDK Error Codes
Raised by the SDK itself, separate from the FaceAuthen API codes.
| Field | Type | Description |
|---|---|---|
40000 | string | Timeout. |
40001 | string | User cancelled — pressed back. |
40002 | string | Required permissions were not granted. |
40003 | string | Opening the camera device failed. Android and Flutter only. |
50000 | string | Unexpected runtime exception. |
60002 | string | Face sanity check failed. |
60003 | string | Face liveness check failed. |
Constant names differ per platform — EkycError.FACE_SANITY_FAILED on Android, kErrorCodeFaceSanityFailed on iOS, EkycFailure.faceSanityFailed on Flutter — but the numeric values match.
The NID-related codes 60000 and 60001 exist in the same SDK but never fire in a FaceAuthen flow, which captures no identity card.
Image Labels
When calling upload directly, use portrait for a camera selfie. The other labels belong to document flows.
| Field | Type | Description |
|---|---|---|
portrait | string | The portrait photo. |
portrait_nfc | string | The portrait read from an NFC chip. Use with face_type: "id_card" at registration. |
See Usage Recommendations for the full vocabulary.
Registering From an ID Card
Register Faces accepts face_type: "id_card" alongside the default selfie. Use it when the enrolment face comes from a document rather than a live capture — for example a portrait extracted while reading an NID chip. The SDK's takeFaces always produces selfie; an id_card face comes from your document flow instead.
Next Steps
- Android SDK Integration — Kotlin integration guide
- iOS SDK Integration — Swift integration guide
- Flutter SDK Integration — Dart integration guide
- Register Faces — enrol the captured images