FaceAuthenticator

Privacy Policy and Terms & Conditions of Use

When using our plugin, please make sure that you agree with our Privacy Policy and our Terms and Conditions of Use.

Settings

Android

In the file ROOT_PROJECT/android/app/build.gradle, add:

android {

    ...

    dataBinding.enabled = true

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

  rootProject.allprojects {
    repositories {
        maven { url "https://repo.combateafraude.com/android/release" }
        maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' }
    }
  }
}

Import the package and call the method add() inside of the initialization in android/app/src/main/java/io/ionic/starter/MainActivity.java:


import com.authenticator.FaceAuthenticatorPlugin;

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    registerPlugin(FaceAuthenticatorPlugin.class);
  }
}

iOS

In the ROOT_PROJECT/ios/Podfile, add to the end of the file:

source 'https://github.com/combateafraude/iOS.git'
source 'https://cdn.cocoapods.org/' # or 'https://github.com/CocoaPods/Specs' if the CDN is down

Finally, add the camera permission to the file ROOT_PROJECT/ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>To read the documents</string>

Ionic

In the file ROOT_PROJECT/package.json add:

"dependencies": {
    "new-face-authenticator-plugin": "https://github.com/combateafraude/Ionic/archive/refs/tags/new-face-authenticator-plugin-v1.0.0.tar.gz"
}

Após, execute:

  1. npm install

  2. ionic capacitor build < platform > [ options ]

Importando


import { FaceAuthenticator } from 'new-face-authenticator-plugin';

Utilizando


    const faceLiveness = new FaceAuthenticator(this.mobileToken, this.personId);

    const response = await faceLiveness.start();

      this.results = [];

      if(response.result == 'SUCCESS'){
        this.results.push('result: SUCCESS');
        this.results.push('isMatch: '+response.isMatch);
        this.results.push('isAlive: '+response.isAlive);
        this.results.push('userId: '+response.userId);

      }else if(response.result == 'FAILURE'){
        this.results.push('result: FAILURE');
        this.results.push('errorMessage: '+response.errorMessage);
      }else{
        this.results.push('result: CANCEL');
      }

FaceAuthenticatorSuccess

Field

String imageUrl Url from the image that was captured by the sdk and is temporaly saved in caf's server.

bool isAlive Liveness return, use this return to check if the user is alive.

String userId Internal indentifier of the user.

FaceAuthenticatorFailure

Field

String errorMessage Message explaning the reason of the failure.

FaceAuthenticatorClosed

Empty object.

Last updated

Logo

2023 © Caf. - All rights reserved