Skip to content

Repository files navigation

FacePlugin

🌐 Company Site - Here

πŸ€— Hugging Face - Here

πŸ›Ÿ Help Center - Here

🐳 Docker Hub - Here

ID Document Recognition SDK β€” iOS (Fully On-Premise)

Unzip docsdk.framework.zip into this folder β†’ run on a physical iPhone (~10 min after Xcode is ready). Jump: Quick Start Β· Get the framework Β· Run the demo Β· License Β· Integrate

Quick Start

Use this for the sample app (check each box in order).

  • Clone ID-Document-Recognition-iOS on a Mac
  • Xcode 15+ (project compatibility Xcode 14; Swift 5)
  • Download docsdk.framework.zip β€” Get the framework
  • Unzip and put docsdk.framework next to DocumentReader.xcodeproj (not the .zip)
  • Open DocumentReader.xcodeproj
  • Set your Signing Team; keep bundle id com.faceplugin.documentreader.app for the demo license (until 12 Aug 2027)
  • Run on a physical iPhone (simulator is not recommended)
  • Grant camera when asked
  • Home status bar shows Ready β†’ Camera / Gallery / About

Own app? β†’ Setup on your own app. Full integration: https://doc.faceplugin.com

Introduction

FacePlugin Document Reader SDK for iOS β€” on-device ID card, passport, and driver license recognition (OCR, MRZ, barcode). This repository is the standalone iOS demo. The runtime is docsdk.framework (download from Google Drive). No other FacePlugin repository is required.

This is an on-premise SDK. All processing stays on the device β€” no biometric data is sent to FacePlugin cloud.

Native binaries are not on GitHub. Download the framework from the Drive link below.

Main Functionalities

Feature Supported
ID Card / Passport / Driver License βœ“
MRZ / Barcode / QR / OCR βœ“
Live camera locate overlay + Capture βœ“
Gallery (front required, back optional) βœ“
Result (fields, images, JSON) βœ“
About βœ“

Product List

Platform Repository
Android ID-Document-Recognition-Android
iOS ID-Document-Recognition-iOS (this repo)
Windows ID-Document-Recognition-Windows
Linux / Docker ID-Document-Recognition-Docker
React Native ID-Document-Recognition-React-Native
Flutter ID-Document-Recognition-Flutter
Ionic Cordova ID-Document-Recognition-Ionic-Cordova

Before you start

Step What you need
1 Xcode 15+ and a physical iPhone (simulator is not recommended)
2 docsdk.framework in this folder β€” Get the framework
3 Demo license is already in the repo (licenseKey for com.faceplugin.documentreader.app, valid until 12 August 2027). Request a new key only if you change the bundle identifier β€” SDK License

Camera and Gallery unlock when the status bar shows Ready.

System requirements

Item Minimum Recommended
Host macOS with Xcode 15+, Swift 5.0 Same
iOS 13.0 (IPHONEOS_DEPLOYMENT_TARGET) 16 or newer
Device iPhone with A12 or newer Recent iPhone
RAM 4 GB 6 GB or more
Camera Rear camera Auto-focus, 1080p
Device Physical device Same; simulator is not for camera

Get the framework (docsdk.framework)

docsdk.framework is a header stub on GitHub because the binary is too large. On Drive it is shipped as docsdk.framework.zip β€” unzip after you download.

Where to download

DocumentReader-iOS-App runtime (Google Drive) β€” file: docsdk.framework.zip

How to place it

git clone https://github.com/Faceplugin-ltd/ID-Document-Recognition-iOS.git
cd ID-Document-Recognition-iOS
  1. Download docsdk.framework.zip from the Drive folder.
  2. Unzip it (double-click in Finder, or unzip docsdk.framework.zip). You should get a docsdk.framework folder β€” not the .zip.
  3. Put docsdk.framework here (repo root, next to DocumentReader.xcodeproj β€” not in a nested folder, and not the zip file):
ID-Document-Recognition-iOS/
β”œβ”€β”€ DocumentReader.xcodeproj
β”œβ”€β”€ DocumentReader/
└── docsdk.framework/                 ← unzipped (not .zip; engine is nested as Frameworks/dcrcore.framework)

If unzip creates docsdk.framework in Downloads, move that folder into this repo. You can delete the .zip afterward.


Run the demo

  1. Open DocumentReader.xcodeproj in Xcode.
  2. Set your Team for signing. Bundle ID is com.faceplugin.documentreader.app.
  3. Run on a device. The demo already has a valid licenseKey for com.faceplugin.documentreader.app.
  4. Wait for the status bar at the bottom of Home: Loading native SDK… β†’ Ready. Camera and From Gallery stay disabled until then.

Home tiles are one row under the title: Camera | Gallery | About.

  • Camera β€” live document overlay; tap Capture when the score is ready (β‰₯ 50%).
  • Gallery β€” pick Front (required) and Back (optional), then Recognize.
  • Result β€” extracted OCR / MRZ / barcode fields and images.

Screenshots

Home β€” Camera, Gallery, About Β  Camera β€” live document overlay and Capture Β  Result β€” extracted OCR / MRZ fields


SDK License

Licenses are offline and bound to your bundle identifier.

The sample app already includes a valid key for com.faceplugin.documentreader.app (until 12 August 2027). You only need a new key if you use a different bundle identifier.

How to get a license

The code below shows how to use the license:

private let licenseKey =
"FP1.RlBMMQMAAQAZ9Zwi8fHG33dpwB8MAgAAugTVCCTnRx8neRXi7q3IQx09+pM/07ZLOE3uhGCXIfQq/jt8i6+oovCghJsTnzx+LbraSzYnYKhFM+8ZpCt5x6/YNgVNh2Wrdq336ehT9ZmWagxWEm/T4sJw0IlrJwxz+uDS01X95P0og2hQy61Rqh6Q2lCsRpBVj6tVpVU7Q4BcnL43JHUZyFIFzZVhgakFrzZ1v2yMX7hZubx1vsVTDS8XZjOEjNyIs2B7th1XczBQV9jRo/Hzq9IFypKxF+w0kqKeiCGgXtEkpVnhH0q2d3Ol3Hwd7VCvN4rwAfXA4LRpBqMMXgN0iFb4GaZ/5RrcuiWGHt6Se1XRdLaVcYeiafY9i0dGnKpWoYC6Wcc3w7Ud9tt/JH3ZCW0VSX3mhbwizb9aUFpfewQ1233B2QkyydYrmcW9WdRyuIITCZl7lxL4Bu+rMuNvYImrbjnPtUMErhwldzp5/KpVD2n8ZuhQVqo/nvxKVkhu49jA5rncA99rBR/j8PA8tQnrkJA/UzbnGZKe5vaUZHHbc2f/8hoyFAd+bYsgWBBGm98d/JoFNeKA/Lj9qBz/96Vhsb31X/g69Mg2FjeKLmPNLRBsdtB5Gq451Ng7SqVBhSLu3izjcEPw0ZNvfgp41+RXMoxr3HrJ0Nrxe+DjbsVVEhXboNK5UoW0K+YwDpRBssLUBD2v0A5O46pNVDj8BjG6P26LADCBiAJCAUUBMF7fdBJVN4bynNDBBmW66ebB8UiHQWqr3JXWGS4yX+ANEOKFA8x241i0loqcmVGGkNRTdDEuE8T4WaDU9WqBAkIAsgWLPid1PUQVJZVceswxeHuK+NkbA4temoT2sYADekl3tZEA2YA4Ax8Z02A3xY1cT7gAnQz6fMxwoRmYKzZevDQ="

let machine = DocSDK.getMachineCode()
let act = Int(DocSDK.setActivation(self.licenseKey))
let initRc = act == 0 ? Int(DocSDK.initSDK()) : act

Please contact us to get a license for your own app.


Setup on your own app

You need docsdk.framework and DocSDK. You do not need this demo’s ViewController / CameraViewController.

  1. Copy docsdk.framework into your project root (Drive).
  2. In Xcode: General β†’ Frameworks, Libraries, and Embedded Content β†’ add it (Embed & Sign).
  3. Add a bridging header (Swift): #import <docsdk/DocSDK.h> β€” Project Navigator β†’ Build Settings β†’ Swift Compiler - General β†’ Objective-C Bridging Header.
  4. Request a license for your bundle identifier, not the demo’s.
  5. Call initSDK and all process methods off the main thread.

Full wiring, permissions, and result JSON: https://doc.faceplugin.com


About SDK

// Bridging header: #import <docsdk/DocSDK.h>

Call order (background queue): getMachineCode β†’ setActivation β†’ initSDK β†’ recognize / locateDocument. 0 = DocSDKSuccess. Process methods return JSON.

DispatchQueue.global(qos: .userInitiated).async {
    var ret = DocSDK.setActivation("FP1.…")
    if ret == 0 {
        ret = DocSDK.initSDK()
    }
}
Method Role
getMachineCode / setActivation / initSDK / deinitSDK License + engine lifecycle
locateDocument(_:) Live corners + score (overlay, no OCR)
recognize(_:) OCR / MRZ / barcode from one image
recognizeFront(_:back:authenticity:) Front + optional back (back may be nil)
documentAuthenticity(_:) Optional authenticity check
Code Constant Status
0 DocSDKSuccess Activate / init OK
1 DocSDKLicenseInvalid Invalid license
2 DocSDKLicenseExpired Expired license
3 DocSDKNotActivated Not activated
4 DocSDKInitFailed Init failed

Troubleshooting

Symptom What to check
Missing / stub docsdk.framework Unzip Drive zip into repo root next to DocumentReader.xcodeproj β€” not the .zip
License invalid / expired Bundle id must be com.faceplugin.documentreader.app for the demo key
Camera / Gallery disabled Wait until the status bar shows Ready
Simulator Use a physical iPhone; simulator is not for camera
Signing / Team Xcode β†’ Signing & Capabilities β†’ pick your Team

Contact

faceplugin.com  faceplugin.com

Releases

Packages

Contributors

Languages