# FaceRecognition - Ionic-Cordova

This demo demonstrates both Face Liveness Detection and Face Recognition with Ionic Cordova framwork for biometric authentication system.

It stands for face recognition Ionic, facial recognition Ionic, face liveness check Ionic, face spoofing prevention Ionic, face matching Ionic, face comparison Ionic, face search engine Ionic, face identification Ionic, etc.

## Github

{% embed url="<https://github.com/kby-ai/FaceRecognition-Ionic-Cordova>" %}

## Google Play

{% embed url="<https://play.google.com/store/apps/details?hl=en_US&id=com.kbyai.facerecognition>" %}

## App Store

{% embed url="<https://apps.apple.com/us/app/kby-ai-face-recognition/id6448648922>" %}

## YouTube

{% embed url="<https://youtu.be/HpDggnWsG1c>" %}

## How to Run

### 1. Prerequisites

Make sure you have `Node.js` and `npm` installed.

Download and install `Node.js` from official websites, and then make sure it's installed or not by running the following commands.

```bash
node -v
npm -v
```

Install `Ionic` CLI globally with npm:

<pre class="language-bash"><code class="lang-bash"><strong>npm install -g @ionic/cli
</strong></code></pre>

Install `Cordova` framework globally as well.

```bash
npm install -g cordova
```

### 2. Running the Android App

2.1. **Add `FacePlugin` To The Project**

Run the following command to add the `FacePlugin` to the `Ionic Cordova` project.

```bash
ionic cordova plugin add ./FacePlugin  
```

2.2. **Build `Android` App**

<pre class="language-bash"><code class="lang-bash"><strong>ionic cordova build android
</strong></code></pre>

2.3. **Add `Camera Permission` App**

Add camera permission on `AndroidManifest.xml` placed at `platforms/android/app/src/main`.

```xml
<uses-permission android:name="android.permission.CAMERA" />
```

Once the camera permission is allowed and app is built, the app can be run on `Android` device with the following command.

```bash
ionic cordova run android
```

### 3. Running the iOS App

3.1. **Add `FacePlugin` To The Project**

Run the following command to add the `FacePlugin` to the `Ionic Cordova` project.

```bash
ionic cordova plugin add ./FacePlugin
```

3.2. **Add `iOS` Platform To The Project**

```bash
ionic cordova platform add ios
```

3.3. **Prepare`iOS` Project**

```bash
ionic cordova prepare ios
```

3.4. **Add`Camera Permission` To `Info.plist`**&#x20;

Open `iOS` workspace in `Xcode`.

```bash
open platforms/ios/face-recognition.xcworkspace
```

Then navigate to the file `Info.plist` in `Xcode`, and add the following entry to request camera permission.

```bash
<key>NSCameraUsageDescription</key>
<string>We need access to your camera for face recognition.</string>
```

Build app finally with `Xcode` and run it on a real device, not simulator
