Face Recognition Ionic-Cordova SDK

Face recognition Ionic Cordova SDK with liveness detection

Code

How to run

✅ Setup Environment

Before getting started, ensure the following are installed on your system:

1. Install Node.js and npm

Download the latest version of Node.js which includes npm. After installation, confirm they are set up correctly by running:

node -v
npm -v

2. Install Ionic CLI and Cordova Globally

Install the required tools globally using npm:

npm install -g @ionic/cli
npm install -g cordova

📱 Running the App on Android

Step 1: Integrate FacePlugin

Navigate to your Ionic project directory and add the plugin:

ionic cordova plugin add ./FacePlugin

Step 2: Build the Android App

Run the following command to compile your app:

ionic cordova build android

Step 3: Add Camera Permission

Locate the AndroidManifest.xml file inside: platforms/android/app/src/main/

Add this permission line within the <manifest> tag:

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

Step 4: Deploy to Android Device

Once permission is added and the build is successful, run the app on a connected Android device:

ionic cordova run android

🍏 Running the App on iOS

Step 1: Add FacePlugin to Project

From your project root, add the FacePlugin:

ionic cordova plugin add ./FacePlugin

Step 2: Add iOS Platform

To enable iOS support, execute:

ionic cordova platform add ios

Step 3: Prepare the iOS Project

This prepares the iOS environment and syncs configurations:

ionic cordova prepare ios

Step 4: Enable Camera Access in Info.plist

  1. Open the iOS workspace using Xcode:

    open platforms/ios/face-recognition.xcworkspace
  2. Inside Xcode, locate the Info.plist file and add the following snippet to request camera access:

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

Step 5: Build and Run

Use Xcode to build and run the app on a physical iOS device (not a simulator).

Last updated