> 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/products/id-document-recognition-sdk/recognition-and-liveness/mobile-sdk/id-document-recognition-ionic-cordova-sdk.md).

# Ionic Cordova

Faceplugin ID Document Recognition Ionic Cordova SDK. Legacy DocumentReaderPlugin layout. Prefer Capacitor for new ID scanning apps.

Use this guide only if you already have a **Cordova** Ionic app. The native engine matches Capacitor. New projects should use [Ionic Capacitor](/products/id-document-recognition-sdk/recognition-and-liveness/mobile-sdk/id-document-recognition-ionic-capacitor-sdk.md).

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

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

### How to run

### ✅ Setup Environment

Install Node.js, Ionic CLI, and Cordova. Physical device recommended (`ionic serve` cannot load the engine).

1. Place `documentreadersdk.aar` at `DocumentReaderPlugin/src/android/documentreadersdk.aar`.
2. Place `docsdk.framework` at `DocumentReaderPlugin/src/ios/Frameworks/docsdk.framework`.
3. Run:

```bash
npm install
npm run setup:android
npm run android
```

Gradle is bootstrapped via `scripts/with-gradle.js`. iOS: put your Apple Team ID in root `build.json`. Physical iPhone; `docsdk` is device arm64.

You can also add the plugin from a local path:

```bash
ionic cordova plugin add ./DocumentReaderPlugin
ionic cordova build android
ionic cordova run android
```

Drive: [Android](https://drive.google.com/drive/folders/1nDSfvj0WtC1lZgzwFd7471ECVtk-nuYH) · [iOS](https://drive.google.com/drive/folders/1do6Ws_BlXGkR_K9jI_ULd1zHjqLGSP4q).

The Android demo license key string in this repo can differ from Capacitor / React Native / Flutter; it is still bound to `com.faceplugin.documentreader`.

### APIs

Same activate → init → locate / recognize / documentRecognition / documentLiveness sequence as the other mobile Document Reader Apps. Status codes **0**–**4**. Native camera helpers: `startLivePreview` / `takeLiveSnapshot` / `stopLivePreview`. Plugin folder: `DocumentReaderPlugin/`.

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

```ts
setActivation(license: string): Promise<number>
```

#### <mark style="color:orange;">init:</mark> This API is used to initialize the SDK

```ts
init(): Promise<number>
```

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

```ts
recognize(front, back?, authenticity?): Promise<string>
```

Also: `getMachineCode`, `locateDocument`, `documentRecognition`, `documentLiveness`, `getLicenseStatus`, `deinit`.

Parse JSON with [Document result JSON](/products/id-document-recognition-sdk/document-result-json.md).

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

### FAQ

**Legacy plugin?** Yes. Prefer [Ionic Capacitor](/products/id-document-recognition-sdk/recognition-and-liveness/mobile-sdk/id-document-recognition-ionic-capacitor-sdk.md) for new apps.

### Related documentation

* [Faceplugin ID Document Recognition Mobile SDK](/products/id-document-recognition-sdk/recognition-and-liveness/mobile-sdk.md) · [Ionic Capacitor](/products/id-document-recognition-sdk/recognition-and-liveness/mobile-sdk/id-document-recognition-ionic-capacitor-sdk.md) · [Glossary](/help/resources/glossary.md)
* [Face Recognition Ionic Cordova SDK](/products/face-recognition-sdk/recognition-and-liveness/mobile-sdk/face-recognition-ionic-cordova-sdk.md)
* [Document result JSON](/products/id-document-recognition-sdk/document-result-json.md)
* [Request a License](/help/request-a-license-and-support.md) · [Status codes](/help/resources/status-codes.md)
* [Combining products (eKYC)](/getting-started/choose-a-product.md) · [SDK comparison](/help/comparisons.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.faceplugin.com/products/id-document-recognition-sdk/recognition-and-liveness/mobile-sdk/id-document-recognition-ionic-cordova-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
