> For the complete documentation index, see [llms.txt](https://doc.faceplugin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.faceplugin.com/id-document-recognition-sdk/id-document-recognition-ios-sdk.md).

# ID Document Recognition iOS SDK

Faceplugin ID Document Recognition iOS SDK. On-premise OCR, MRZ, and authenticity. docsdk.framework, setActivation, initSDK, locateDocument, recognize.

Fully on-premise **ID Document Recognition SDK for iOS**. Native class: `DocSDK`. Demo bundle: **`com.faceplugin.documentreader.app`**.

### Code <a href="#setup" id="setup"></a>

{% embed url="<https://github.com/Faceplugin-ltd/ID-Document-Recognition-iOS>" %}

### Setup <a href="#setup" id="setup"></a>

1. Unzip `docsdk.framework.zip` from [Google Drive](https://drive.google.com/drive/folders/1do6Ws_BlXGkR_K9jI_ULd1zHjqLGSP4q) next to `DocumentReader.xcodeproj`. Engine may nest as `Frameworks/dcrcore.framework` inside `docsdk.framework`.
2. Add `docsdk.framework` to the project in Xcode (**Embed & Sign**). Bridging: `#import <docsdk/DocSDK.h>`.
3. Set **your** Signing Team. Physical iPhone, iOS 13+, Xcode 15+.

Status codes: **0** Success, **1** Invalid license, **2** Expired, **3** Not activated, **4** Init failed.

### APIs

#### <mark style="color:orange;">setActivation:</mark> This API is used to activate the SDK <a href="#setactivation" id="setactivation"></a>

```objectivec
+(int)setActivation:(NSString*)license;
```

#### <mark style="color:orange;">initSDK:</mark> This API is used to initialize the SDK <a href="#initsdk" id="initsdk"></a>

```objectivec
+(int)initSDK;
```

#### <mark style="color:orange;">getMachineCode:</mark> This API is used to retrieve the machine code <a href="#getmachinecode" id="getmachinecode"></a>

```objectivec
+(NSString*)getMachineCode;
```

#### <mark style="color:orange;">getLicenseStatus:</mark> This API is used to read recognition and authenticity flags <a href="#getlicensestatus" id="getlicensestatus"></a>

```objectivec
+(NSString*)getLicenseStatus;
+(NSString*)lastLicenseError;
```

#### <mark style="color:orange;">locateDocument:</mark> This API is used to find document corners on a preview frame <a href="#locatedocument" id="locatedocument"></a>

```objectivec
+(NSString*)locateDocument:(UIImage*)image;
```

**No OCR.** Overlay only.

#### <mark style="color:orange;">recognize:</mark> This API is used to run FullProcess <a href="#recognize" id="recognize"></a>

```objectivec
+(NSString*)recognize:(UIImage*)image;
+(NSString*)recognize:(UIImage*)image authenticity:(BOOL)authenticity;
+(NSString*)recognize:(UIImage*)image authenticityMode:(NSString*)mode;
+(NSString*)recognizeFront:(UIImage*)front back:(UIImage*)back authenticityMode:(NSString*)mode;
```

#### <mark style="color:orange;">documentRecognition:</mark> This API is used to run OCR / MRZ / barcode / image quality only <a href="#documentrecognition" id="documentrecognition"></a>

```objectivec
+(NSString*)documentRecognition:(UIImage*)image;
+(NSString*)documentRecognitionFront:(UIImage*)front back:(UIImage*)back;
```

#### <mark style="color:orange;">documentLiveness:</mark> This API is used to run authenticity / security only <a href="#documentliveness" id="documentliveness"></a>

```objectivec
+(NSString*)documentLiveness:(UIImage*)image;
+(NSString*)documentLivenessFront:(UIImage*)front back:(UIImage*)back;
```

#### <mark style="color:orange;">startNewSession:</mark> This API is used to open a FullProcess session before recognize

```objectivec
+(NSString*)startNewSession:(NSString*)optionsJson;
```

#### <mark style="color:orange;">deinitSDK:</mark> This API is used to unload the engine <a href="#deinitsdk" id="deinitsdk"></a>

```objectivec
+(NSString*)deinitSDK;
```

### Run the demo

1. Unzip `docsdk.framework.zip` next to `DocumentReader.xcodeproj`. Engine may nest as `Frameworks/dcrcore.framework` inside `docsdk.framework`.
2. Keep demo bundle **`com.faceplugin.documentreader.app`**.
3. Physical iPhone, iOS 13+, Xcode 15+.
4. Home: Camera, Gallery, About. Result JSON matches [Document result JSON](/id-document-recognition-sdk/document-result-json.md).

### License

Licenses are **offline**. Request a new `FP1.…` for your own app.

[Request a License & Support](/request-a-license-and-support.md) · [Contact US](/contact-us.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.faceplugin.com/id-document-recognition-sdk/id-document-recognition-ios-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
