On-device ID document recognition (OCR, MRZ, and portrait extraction) for iOS. Scan passports, national ID cards, and driver's licenses entirely on the device.
Part of the FaceOnLive on-premises biometric SDK suite.
- Extract text fields, MRZ, and the portrait photo from an ID.
- On-device and offline — no data leaves the phone.
- Camera and photo-library input; structured JSON output.
| Min iOS | 13.0+ |
| Language | Swift |
| IDE | Xcode 14+ |
| Framework | idsdk.framework (included) |
- Open the project in Xcode.
- Get a license key — free trial at https://faceonlive.com.
- In
IDCardRecognition/ViewController.swift, replace<YOUR_LICENSE_KEY>inIDSDK.setActivation(...). - Build and run on a device.
var ret = IDSDK.setActivation("<YOUR_LICENSE_KEY>")
if ret == SDK_SUCCESS.rawValue {
ret = IDSDK.initSDK()
}
let json = IDSDK.idcardRecognition(image) // JSON string with recognized fields| Method | Description | Returns |
|---|---|---|
setActivation(license) |
Activate with your license key. | SDK_SUCCESS or error |
initSDK() |
Load the recognition models. | SDK_SUCCESS or error |
idcardRecognition(image) |
Recognize an ID document in the image. | JSON string, or nil |
Result JSON: Document Name, Issuing State Code, Full Name, MRZ, and an Images object with base64 Portrait and Document crops.
Requires a valid license key — get one at faceonlive.com. Never commit your key. Questions: contact@faceonlive.com
This repository contains the source/demo code only. Download the complete SDK — engine libraries and models, with full project structure — from the Releases page and extract it over this project.