\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50 |
51 | [lints]
52 | sketchy-null-number=warn
53 | sketchy-null-mixed=warn
54 | sketchy-number=warn
55 | untyped-type-import=warn
56 | nonstrict-import=warn
57 | deprecated-type=warn
58 | unsafe-getters-setters=warn
59 | inexact-spread=warn
60 | unnecessary-invariant=warn
61 | signature-verification-failure=warn
62 | deprecated-utility=error
63 |
64 | [strict]
65 | deprecated-type
66 | nonstrict-import
67 | sketchy-null
68 | unclear-type
69 | unsafe-getters-setters
70 | untyped-import
71 | untyped-type-import
72 |
73 | [version]
74 | ^0.113.0
75 |
--------------------------------------------------------------------------------
/example/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 |
24 | # Android/IntelliJ
25 | #
26 | build/
27 | .gradle
28 | local.properties
29 | *.iml
30 |
31 | # node.js
32 | #
33 | node_modules/
34 | npm-debug.log
35 | yarn-error.log
36 |
37 | # BUCK
38 | buck-out/
39 | \.buckd/
40 | *.keystore
41 | !debug.keystore
42 |
43 | # fastlane
44 | #
45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46 | # screenshots whenever they are needed.
47 | # For more information about the recommended setup visit:
48 | # https://docs.fastlane.tools/best-practices/source-control/
49 |
50 | */fastlane/report.xml
51 | */fastlane/Preview.html
52 | */fastlane/screenshots
53 |
54 | # Bundle artifact
55 | *.jsbundle
56 |
57 | # CocoaPods
58 | /ios/Pods/
59 |
60 |
61 | .idea/
62 |
--------------------------------------------------------------------------------
/example/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | bracketSpacing: false,
3 | jsxBracketSameLine: true,
4 | singleQuote: true,
5 | trailingComma: 'all',
6 | };
7 |
--------------------------------------------------------------------------------
/example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/example/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { StyleSheet, View, Button, Text, Image, TouchableHighlight, Alert, LogBox, NativeEventEmitter } from 'react-native'
3 | import { launchImageLibrary } from 'react-native-image-picker';
4 | import FaceSDK, { Enum, FaceCaptureResponse, LivenessResponse, MatchFacesResponse, MatchFacesRequest, MatchFacesImage, MatchFacesSimilarityThresholdSplit, RNFaceApi } from '@regulaforensics/react-native-face-api'
5 |
6 | LogBox.ignoreLogs(['new NativeEventEmitter']);
7 | const eventManager = new NativeEventEmitter(RNFaceApi)
8 |
9 | var image1 = new MatchFacesImage()
10 | var image2 = new MatchFacesImage()
11 |
12 | export default class App extends Component {
13 | constructor(props) {
14 | super(props)
15 |
16 | eventManager.addListener('videoEncoderCompletionEvent', json => {
17 | response = JSON.parse(json)
18 | transactionId = response["transactionId"];
19 | success = response["success"];
20 | console.log("video_encoder_completion:");
21 | console.log(" success: " + success);
22 | console.log(" transactionId: " + transactionId);
23 | })
24 |
25 | FaceSDK.init(json => {
26 | response = JSON.parse(json)
27 | if (!response["success"]) {
28 | console.log("Init failed: ");
29 | console.log(json);
30 | }
31 | }, e => { })
32 |
33 | this.state = {
34 | img1: require('./images/portrait.png'),
35 | img2: require('./images/portrait.png'),
36 | similarity: "nil",
37 | liveness: "nil"
38 | }
39 | }
40 |
41 | pickImage(first) {
42 | Alert.alert("Select option", "", [
43 | {
44 | text: "Use gallery",
45 | onPress: () => launchImageLibrary({ includeBase64: true }, response => {
46 | if (response.assets == undefined) return
47 | this.setImage(first, response.assets[0].base64, Enum.ImageType.PRINTED)
48 | })
49 | },
50 | {
51 | text: "Use camera",
52 | onPress: () => FaceSDK.presentFaceCaptureActivity(result => {
53 | this.setImage(first, FaceCaptureResponse.fromJson(JSON.parse(result)).image.bitmap, Enum.ImageType.LIVE)
54 | }, e => { })
55 | }], { cancelable: true })
56 | }
57 |
58 | setImage(first, base64, type) {
59 | if (base64 == null) return
60 | this.setState({ similarity: "nil" })
61 | if (first) {
62 | image1.bitmap = base64
63 | image1.imageType = type
64 | this.setState({ img1: { uri: "data:image/png;base64," + base64 } })
65 | this.setState({ liveness: "nil" })
66 | } else {
67 | image2.bitmap = base64
68 | image2.imageType = type
69 | this.setState({ img2: { uri: "data:image/png;base64," + base64 } })
70 | }
71 | }
72 |
73 | clearResults() {
74 | this.setState({
75 | img1: require('./images/portrait.png'),
76 | img2: require('./images/portrait.png'),
77 | similarity: "nil",
78 | liveness: "nil"
79 | })
80 | image1 = new MatchFacesImage()
81 | image2 = new MatchFacesImage()
82 | }
83 |
84 | matchFaces() {
85 | if (image1 == null || image1.bitmap == null || image1.bitmap == "" || image2 == null || image2.bitmap == null || image2.bitmap == "")
86 | return
87 | this.setState({ similarity: "Processing..." })
88 | request = new MatchFacesRequest()
89 | request.images = [image1, image2]
90 | FaceSDK.matchFaces(JSON.stringify(request), response => {
91 | response = MatchFacesResponse.fromJson(JSON.parse(response))
92 | FaceSDK.matchFacesSimilarityThresholdSplit(JSON.stringify(response.results), 0.75, str => {
93 | var split = MatchFacesSimilarityThresholdSplit.fromJson(JSON.parse(str))
94 | this.setState({ similarity: split.matchedFaces.length > 0 ? ((split.matchedFaces[0].similarity * 100).toFixed(2) + "%") : "error" })
95 | }, e => { this.setState({ similarity: e }) })
96 | }, e => { this.setState({ similarity: e }) })
97 | }
98 |
99 | liveness() {
100 | FaceSDK.startLiveness(result => {
101 | result = LivenessResponse.fromJson(JSON.parse(result))
102 |
103 | this.setImage(true, result.bitmap, Enum.ImageType.LIVE)
104 | if (result.bitmap != null)
105 | this.setState({ liveness: result["liveness"] == Enum.LivenessStatus.PASSED ? "passed" : "unknown" })
106 | }, e => { })
107 | }
108 |
109 | render() {
110 | return (
111 |
112 |
113 |
114 |
115 | this.pickImage(true)}>
116 |
123 |
124 |
125 |
126 | this.pickImage(false)}>
127 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
147 |
148 |
155 |
156 |
163 |
164 |
165 | Similarity: {this.state.similarity}
166 | Liveness: {this.state.liveness}
167 |
168 |
169 |
170 | )
171 | }
172 | }
173 |
174 | const styles = StyleSheet.create({
175 | container: {
176 | width: '100%',
177 | height: '100%',
178 | flex: 1,
179 | justifyContent: 'center',
180 | alignItems: 'center',
181 | backgroundColor: '#F5FCFF',
182 | marginBottom: 12,
183 | },
184 | welcome: {
185 | fontSize: 20,
186 | textAlign: 'center',
187 | margin: 10,
188 | },
189 | instructions: {
190 | textAlign: 'center',
191 | color: '#333333',
192 | marginBottom: 5,
193 | },
194 | resultsScreenBackButton: {
195 | position: 'absolute',
196 | bottom: 0,
197 | right: 20
198 | }
199 | })
200 |
--------------------------------------------------------------------------------
/example/__tests__/App-test.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native';
6 | import React from 'react';
7 | import App from '../App';
8 |
9 | // Note: test renderer must be required after react-native.
10 | import renderer from 'react-test-renderer';
11 |
12 | it('renders correctly', () => {
13 | renderer.create();
14 | });
15 |
--------------------------------------------------------------------------------
/example/android/app/_BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12 |
13 | lib_deps = []
14 |
15 | create_aar_targets(glob(["libs/*.aar"]))
16 |
17 | create_jar_targets(glob(["libs/*.jar"]))
18 |
19 | android_library(
20 | name = "all-libs",
21 | exported_deps = lib_deps,
22 | )
23 |
24 | android_library(
25 | name = "app-code",
26 | srcs = glob([
27 | "src/main/java/**/*.java",
28 | ]),
29 | deps = [
30 | ":all-libs",
31 | ":build_config",
32 | ":res",
33 | ],
34 | )
35 |
36 | android_build_config(
37 | name = "build_config",
38 | package = "com.faceapi",
39 | )
40 |
41 | android_resource(
42 | name = "res",
43 | package = "com.faceapi",
44 | res = "src/main/res",
45 | )
46 |
47 | android_binary(
48 | name = "app",
49 | keystore = "//android/keystores:debug",
50 | manifest = "src/main/AndroidManifest.xml",
51 | package_type = "debug",
52 | deps = [
53 | ":app-code",
54 | ],
55 | )
56 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | project.ext.react = [
6 | enableHermes: false,
7 | ]
8 |
9 | apply from: "../../node_modules/react-native/react.gradle"
10 |
11 | def enableSeparateBuildPerCPUArchitecture = false
12 | def enableProguardInReleaseBuilds = false
13 | def jscFlavor = 'org.webkit:android-jsc:+'
14 | def enableHermes = project.ext.react.get("enableHermes", false)
15 |
16 | android {
17 | compileSdkVersion rootProject.ext.compileSdkVersion
18 |
19 | defaultConfig {
20 | applicationId "com.regula.face.api"
21 | minSdkVersion rootProject.ext.minSdkVersion
22 | targetSdkVersion rootProject.ext.targetSdkVersion
23 | versionCode 1
24 | versionName "1.0"
25 | multiDexEnabled true
26 | }
27 | splits {
28 | abi {
29 | reset()
30 | enable enableSeparateBuildPerCPUArchitecture
31 | universalApk false
32 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
33 | }
34 | }
35 | buildTypes {
36 | release {
37 | signingConfig signingConfigs.debug
38 | minifyEnabled enableProguardInReleaseBuilds
39 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
40 | }
41 | }
42 | packagingOptions {
43 | pickFirst "lib/armeabi-v7a/libc++_shared.so"
44 | pickFirst "lib/arm64-v8a/libc++_shared.so"
45 | pickFirst "lib/x86/libc++_shared.so"
46 | pickFirst "lib/x86_64/libc++_shared.so"
47 | }
48 | applicationVariants.all { variant ->
49 | variant.outputs.each { output ->
50 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
51 | def abi = output.getFilter(OutputFile.ABI)
52 | if (abi != null) {
53 | output.versionCodeOverride =
54 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
55 | }
56 | }
57 | }
58 | }
59 |
60 | dependencies {
61 | implementation fileTree(dir: "libs", include: ["*.jar"])
62 | //noinspection GradleDynamicVersion
63 | implementation "com.facebook.react:react-native:+"
64 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
65 | implementation "com.android.support:multidex:1.0.3"
66 |
67 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
68 | exclude group: 'com.facebook.fbjni'
69 | }
70 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
71 | exclude group: 'com.facebook.flipper'
72 | }
73 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
74 | exclude group: 'com.facebook.flipper'
75 | }
76 | if (enableHermes) {
77 | def hermesPath = "../../node_modules/hermes-engine/android/"
78 | debugImplementation files(hermesPath + "hermes-debug.aar")
79 | releaseImplementation files(hermesPath + "hermes-release.aar")
80 | } else {
81 | implementation jscFlavor
82 | }
83 | }
84 |
85 | task copyDownloadableDepsToLibs(type: Copy) {
86 | from configurations.implementation
87 | into 'libs'
88 | }
89 |
90 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
91 |
--------------------------------------------------------------------------------
/example/android/app/build_defs.bzl:
--------------------------------------------------------------------------------
1 | """Helper definitions to glob .aar and .jar targets"""
2 |
3 | def create_aar_targets(aarfiles):
4 | for aarfile in aarfiles:
5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6 | lib_deps.append(":" + name)
7 | android_prebuilt_aar(
8 | name = name,
9 | aar = aarfile,
10 | )
11 |
12 | def create_jar_targets(jarfiles):
13 | for jarfile in jarfiles:
14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15 | lib_deps.append(":" + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/java/com/regula/face/api/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.regula.face.api;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | public class ReactNativeFlipper {
28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29 | if (FlipperUtils.shouldEnableFlipper(context)) {
30 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
31 |
32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
33 | client.addPlugin(new ReactFlipperPlugin());
34 | client.addPlugin(new DatabasesFlipperPlugin(context));
35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
36 | client.addPlugin(CrashReporterPlugin.getInstance());
37 |
38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
39 | NetworkingModule.setCustomClientBuilder(
40 | new NetworkingModule.CustomClientBuilder() {
41 | @Override
42 | public void apply(OkHttpClient.Builder builder) {
43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
44 | }
45 | });
46 | client.addPlugin(networkFlipperPlugin);
47 | client.start();
48 |
49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
50 | // Hence we run if after all native modules have been initialized
51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
52 | if (reactContext == null) {
53 | reactInstanceManager.addReactInstanceEventListener(
54 | new ReactInstanceManager.ReactInstanceEventListener() {
55 | @Override
56 | public void onReactContextInitialized(ReactContext reactContext) {
57 | reactInstanceManager.removeReactInstanceEventListener(this);
58 | reactContext.runOnNativeModulesQueueThread(
59 | new Runnable() {
60 | @Override
61 | public void run() {
62 | client.addPlugin(new FrescoFlipperPlugin());
63 | }
64 | });
65 | }
66 | });
67 | } else {
68 | client.addPlugin(new FrescoFlipperPlugin());
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
15 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/regula/face/api/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.regula.face.api;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript. This is used to schedule
9 | * rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "FaceApi";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/regula/face/api/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.regula.face.api;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactInstanceManager;
8 | import com.facebook.react.ReactNativeHost;
9 | import com.facebook.react.ReactPackage;
10 | import com.facebook.soloader.SoLoader;
11 | import java.lang.reflect.InvocationTargetException;
12 | import java.util.List;
13 |
14 | public class MainApplication extends Application implements ReactApplication {
15 |
16 | private final ReactNativeHost mReactNativeHost =
17 | new ReactNativeHost(this) {
18 | @Override
19 | public boolean getUseDeveloperSupport() {
20 | return BuildConfig.DEBUG;
21 | }
22 |
23 | @Override
24 | protected List getPackages() {
25 | @SuppressWarnings("UnnecessaryLocalVariable")
26 | List packages = new PackageList(this).getPackages();
27 | // Packages that cannot be autolinked yet can be added manually here, for example:
28 | // packages.add(new MyReactNativePackage());
29 | return packages;
30 | }
31 |
32 | @Override
33 | protected String getJSMainModuleName() {
34 | return "index";
35 | }
36 | };
37 |
38 | @Override
39 | public ReactNativeHost getReactNativeHost() {
40 | return mReactNativeHost;
41 | }
42 |
43 | @Override
44 | public void onCreate() {
45 | super.onCreate();
46 | SoLoader.init(this, /* native exopackage */ false);
47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
48 | }
49 |
50 | /**
51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like
52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
53 | *
54 | * @param context
55 | * @param reactInstanceManager
56 | */
57 | private static void initializeFlipper(
58 | Context context, ReactInstanceManager reactInstanceManager) {
59 | if (BuildConfig.DEBUG) {
60 | try {
61 | /*
62 | We use reflection here to pick up the class that initializes Flipper,
63 | since Flipper library is not available in release mode
64 | */
65 | Class> aClass = Class.forName("com.regula.face.api.ReactNativeFlipper");
66 | aClass
67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
68 | .invoke(null, context, reactInstanceManager);
69 | } catch (ClassNotFoundException e) {
70 | e.printStackTrace();
71 | } catch (NoSuchMethodException e) {
72 | e.printStackTrace();
73 | } catch (IllegalAccessException e) {
74 | e.printStackTrace();
75 | } catch (InvocationTargetException e) {
76 | e.printStackTrace();
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FaceApi
3 |
4 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext {
3 | buildToolsVersion = "33.0.0"
4 | minSdkVersion = 21
5 | compileSdkVersion = 33
6 | targetSdkVersion = 33
7 | }
8 | repositories {
9 | google()
10 | mavenCentral()
11 | }
12 | dependencies {
13 | classpath('com.android.tools.build:gradle:7.2.2')
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | mavenCentral()
20 | mavenLocal()
21 | maven {
22 | url("$rootDir/../node_modules/react-native/android")
23 | }
24 | maven {
25 | url("$rootDir/../node_modules/jsc-android/dist")
26 | }
27 |
28 | google()
29 | maven { url 'https://www.jitpack.io' }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
2 | org.gradle.daemon=true
3 | org.gradle.parallel=true
4 | org.gradle.configureondemand=true
5 |
6 | android.useAndroidX=true
7 | android.enableJetifier=true
8 | FLIPPER_VERSION=0.99.0
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin or MSYS, switch paths to Windows format before running java
129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'FaceApi'
2 | include ':react-native-customized-image-picker'
3 | project(':react-native-customized-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-customized-image-picker/android')
4 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
5 | include ':app'
6 |
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "FaceApi",
3 | "displayName": "FaceApi"
4 | }
--------------------------------------------------------------------------------
/example/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/example/images/portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melody413/ReactNative-Face-API/44b7c3519804035da2f72c3e297185f09ab5d2ad/example/images/portrait.png
--------------------------------------------------------------------------------
/example/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import {AppRegistry} from 'react-native';
6 | import App from './App';
7 | import {name as appName} from './app.json';
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/example/ios/FaceApi.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
11 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
13 | 8C6CAAFB26C17DFC006835D3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8C6CAAFD26C17DFC006835D3 /* LaunchScreen.storyboard */; };
14 | ED1B4D57DF4F1E4F4B106ED3 /* libPods-FaceApi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4C30695BA7B5428B5C0078F /* libPods-FaceApi.a */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXFileReference section */
18 | 0074488C78A108717E739B9E /* Pods-FaceApi-FaceApiTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi-FaceApiTests.release.xcconfig"; path = "Target Support Files/Pods-FaceApi-FaceApiTests/Pods-FaceApi-FaceApiTests.release.xcconfig"; sourceTree = ""; };
19 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
20 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
21 | 00E356F21AD99517003FC87E /* FaceApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FaceApiTests.m; sourceTree = ""; };
22 | 093A085EA63AAF5F29293E44 /* Pods-FaceApi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi.debug.xcconfig"; path = "Target Support Files/Pods-FaceApi/Pods-FaceApi.debug.xcconfig"; sourceTree = ""; };
23 | 13B07F961A680F5B00A75B9A /* FaceApi.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FaceApi.app; sourceTree = BUILT_PRODUCTS_DIR; };
24 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = FaceApi/AppDelegate.h; sourceTree = ""; };
25 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = FaceApi/AppDelegate.m; sourceTree = ""; };
26 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = FaceApi/Images.xcassets; sourceTree = ""; };
27 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = FaceApi/Info.plist; sourceTree = ""; };
28 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = FaceApi/main.m; sourceTree = ""; };
29 | 2ADB181B4CA39A9715E21864 /* libPods-FaceApi-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FaceApi-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
30 | 46E18EDC6C0480CEB9C923B6 /* Pods-FaceApi-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi-tvOS.release.xcconfig"; path = "Target Support Files/Pods-FaceApi-tvOS/Pods-FaceApi-tvOS.release.xcconfig"; sourceTree = ""; };
31 | 7A841189AF1272F822B27359 /* libPods-FaceApi-FaceApiTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FaceApi-FaceApiTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
32 | 8280E422E90AC565D64F63F8 /* Pods-FaceApi-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-FaceApi-tvOS/Pods-FaceApi-tvOS.debug.xcconfig"; sourceTree = ""; };
33 | 8C6CAAFC26C17DFC006835D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
34 | 9AA47E55D3A2055662C76017 /* libPods-FaceApi-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FaceApi-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
35 | AA151905ADD470CB04BB4D54 /* Pods-FaceApi-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-FaceApi-tvOSTests/Pods-FaceApi-tvOSTests.release.xcconfig"; sourceTree = ""; };
36 | C4C30695BA7B5428B5C0078F /* libPods-FaceApi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FaceApi.a"; sourceTree = BUILT_PRODUCTS_DIR; };
37 | CB82E17B857594B755F192CC /* Pods-FaceApi.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi.release.xcconfig"; path = "Target Support Files/Pods-FaceApi/Pods-FaceApi.release.xcconfig"; sourceTree = ""; };
38 | D8257E79E3ADAE0C91B829C5 /* Pods-FaceApi-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-FaceApi-tvOSTests/Pods-FaceApi-tvOSTests.debug.xcconfig"; sourceTree = ""; };
39 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
40 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
41 | F2F076169A853DF29A2D9895 /* Pods-FaceApi-FaceApiTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FaceApi-FaceApiTests.debug.xcconfig"; path = "Target Support Files/Pods-FaceApi-FaceApiTests/Pods-FaceApi-FaceApiTests.debug.xcconfig"; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | ED1B4D57DF4F1E4F4B106ED3 /* libPods-FaceApi.a in Frameworks */,
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | /* End PBXFrameworksBuildPhase section */
54 |
55 | /* Begin PBXGroup section */
56 | 00E356EF1AD99517003FC87E /* FaceApiTests */ = {
57 | isa = PBXGroup;
58 | children = (
59 | 00E356F21AD99517003FC87E /* FaceApiTests.m */,
60 | 00E356F01AD99517003FC87E /* Supporting Files */,
61 | );
62 | path = FaceApiTests;
63 | sourceTree = "";
64 | };
65 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
66 | isa = PBXGroup;
67 | children = (
68 | 00E356F11AD99517003FC87E /* Info.plist */,
69 | );
70 | name = "Supporting Files";
71 | sourceTree = "";
72 | };
73 | 10F1119C640875AD9C19308E /* Pods */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 093A085EA63AAF5F29293E44 /* Pods-FaceApi.debug.xcconfig */,
77 | CB82E17B857594B755F192CC /* Pods-FaceApi.release.xcconfig */,
78 | F2F076169A853DF29A2D9895 /* Pods-FaceApi-FaceApiTests.debug.xcconfig */,
79 | 0074488C78A108717E739B9E /* Pods-FaceApi-FaceApiTests.release.xcconfig */,
80 | 8280E422E90AC565D64F63F8 /* Pods-FaceApi-tvOS.debug.xcconfig */,
81 | 46E18EDC6C0480CEB9C923B6 /* Pods-FaceApi-tvOS.release.xcconfig */,
82 | D8257E79E3ADAE0C91B829C5 /* Pods-FaceApi-tvOSTests.debug.xcconfig */,
83 | AA151905ADD470CB04BB4D54 /* Pods-FaceApi-tvOSTests.release.xcconfig */,
84 | );
85 | path = Pods;
86 | sourceTree = "";
87 | };
88 | 13B07FAE1A68108700A75B9A /* FaceApi */ = {
89 | isa = PBXGroup;
90 | children = (
91 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
92 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
93 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
94 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
95 | 13B07FB61A68108700A75B9A /* Info.plist */,
96 | 8C6CAAFD26C17DFC006835D3 /* LaunchScreen.storyboard */,
97 | 13B07FB71A68108700A75B9A /* main.m */,
98 | );
99 | name = FaceApi;
100 | sourceTree = "";
101 | };
102 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
103 | isa = PBXGroup;
104 | children = (
105 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
106 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
107 | 2ADB181B4CA39A9715E21864 /* libPods-FaceApi-tvOS.a */,
108 | 9AA47E55D3A2055662C76017 /* libPods-FaceApi-tvOSTests.a */,
109 | C4C30695BA7B5428B5C0078F /* libPods-FaceApi.a */,
110 | 7A841189AF1272F822B27359 /* libPods-FaceApi-FaceApiTests.a */,
111 | );
112 | name = Frameworks;
113 | sourceTree = "";
114 | };
115 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
116 | isa = PBXGroup;
117 | children = (
118 | );
119 | name = Libraries;
120 | sourceTree = "";
121 | };
122 | 83CBB9F61A601CBA00E9B192 = {
123 | isa = PBXGroup;
124 | children = (
125 | 13B07FAE1A68108700A75B9A /* FaceApi */,
126 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
127 | 00E356EF1AD99517003FC87E /* FaceApiTests */,
128 | 83CBBA001A601CBA00E9B192 /* Products */,
129 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
130 | 10F1119C640875AD9C19308E /* Pods */,
131 | );
132 | indentWidth = 2;
133 | sourceTree = "";
134 | tabWidth = 2;
135 | usesTabs = 0;
136 | };
137 | 83CBBA001A601CBA00E9B192 /* Products */ = {
138 | isa = PBXGroup;
139 | children = (
140 | 13B07F961A680F5B00A75B9A /* FaceApi.app */,
141 | );
142 | name = Products;
143 | sourceTree = "";
144 | };
145 | /* End PBXGroup section */
146 |
147 | /* Begin PBXNativeTarget section */
148 | 13B07F861A680F5B00A75B9A /* FaceApi */ = {
149 | isa = PBXNativeTarget;
150 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "FaceApi" */;
151 | buildPhases = (
152 | FA21AD0185509083CA8ECA04 /* [CP] Check Pods Manifest.lock */,
153 | FD10A7F022414F080027D42C /* Start Packager */,
154 | 13B07F871A680F5B00A75B9A /* Sources */,
155 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
156 | 13B07F8E1A680F5B00A75B9A /* Resources */,
157 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
158 | 0D3CAFD7AD7C8247CCAC4AFB /* [CP] Embed Pods Frameworks */,
159 | 5C45C55E8415C2E356D5C5AD /* [CP] Copy Pods Resources */,
160 | );
161 | buildRules = (
162 | );
163 | dependencies = (
164 | );
165 | name = FaceApi;
166 | productName = FaceApi;
167 | productReference = 13B07F961A680F5B00A75B9A /* FaceApi.app */;
168 | productType = "com.apple.product-type.application";
169 | };
170 | /* End PBXNativeTarget section */
171 |
172 | /* Begin PBXProject section */
173 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
174 | isa = PBXProject;
175 | attributes = {
176 | LastUpgradeCheck = 1130;
177 | TargetAttributes = {
178 | 13B07F861A680F5B00A75B9A = {
179 | LastSwiftMigration = 1120;
180 | };
181 | };
182 | };
183 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "FaceApi" */;
184 | compatibilityVersion = "Xcode 3.2";
185 | developmentRegion = en;
186 | hasScannedForEncodings = 0;
187 | knownRegions = (
188 | en,
189 | Base,
190 | );
191 | mainGroup = 83CBB9F61A601CBA00E9B192;
192 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
193 | projectDirPath = "";
194 | projectRoot = "";
195 | targets = (
196 | 13B07F861A680F5B00A75B9A /* FaceApi */,
197 | );
198 | };
199 | /* End PBXProject section */
200 |
201 | /* Begin PBXResourcesBuildPhase section */
202 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
203 | isa = PBXResourcesBuildPhase;
204 | buildActionMask = 2147483647;
205 | files = (
206 | 8C6CAAFB26C17DFC006835D3 /* LaunchScreen.storyboard in Resources */,
207 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | };
211 | /* End PBXResourcesBuildPhase section */
212 |
213 | /* Begin PBXShellScriptBuildPhase section */
214 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
215 | isa = PBXShellScriptBuildPhase;
216 | buildActionMask = 2147483647;
217 | files = (
218 | );
219 | inputPaths = (
220 | );
221 | name = "Bundle React Native code and images";
222 | outputPaths = (
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | shellPath = /bin/sh;
226 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
227 | };
228 | 0D3CAFD7AD7C8247CCAC4AFB /* [CP] Embed Pods Frameworks */ = {
229 | isa = PBXShellScriptBuildPhase;
230 | buildActionMask = 2147483647;
231 | files = (
232 | );
233 | inputPaths = (
234 | "${PODS_ROOT}/Target Support Files/Pods-FaceApi/Pods-FaceApi-frameworks.sh",
235 | "${PODS_ROOT}/FaceSDKBeta/FaceSDK.framework",
236 | "${PODS_ROOT}/FaceSDKBeta/FaceSDK.framework.dSYM",
237 | );
238 | name = "[CP] Embed Pods Frameworks";
239 | outputPaths = (
240 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FaceSDK.framework",
241 | "${DWARF_DSYM_FOLDER_PATH}/FaceSDK.framework.dSYM",
242 | );
243 | runOnlyForDeploymentPostprocessing = 0;
244 | shellPath = /bin/sh;
245 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FaceApi/Pods-FaceApi-frameworks.sh\"\n";
246 | showEnvVarsInLog = 0;
247 | };
248 | 5C45C55E8415C2E356D5C5AD /* [CP] Copy Pods Resources */ = {
249 | isa = PBXShellScriptBuildPhase;
250 | buildActionMask = 2147483647;
251 | files = (
252 | );
253 | inputPaths = (
254 | "${PODS_ROOT}/Target Support Files/Pods-FaceApi/Pods-FaceApi-resources.sh",
255 | "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
256 | );
257 | name = "[CP] Copy Pods Resources";
258 | outputPaths = (
259 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
260 | );
261 | runOnlyForDeploymentPostprocessing = 0;
262 | shellPath = /bin/sh;
263 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FaceApi/Pods-FaceApi-resources.sh\"\n";
264 | showEnvVarsInLog = 0;
265 | };
266 | FA21AD0185509083CA8ECA04 /* [CP] Check Pods Manifest.lock */ = {
267 | isa = PBXShellScriptBuildPhase;
268 | buildActionMask = 2147483647;
269 | files = (
270 | );
271 | inputFileListPaths = (
272 | );
273 | inputPaths = (
274 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
275 | "${PODS_ROOT}/Manifest.lock",
276 | );
277 | name = "[CP] Check Pods Manifest.lock";
278 | outputFileListPaths = (
279 | );
280 | outputPaths = (
281 | "$(DERIVED_FILE_DIR)/Pods-FaceApi-checkManifestLockResult.txt",
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | shellPath = /bin/sh;
285 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
286 | showEnvVarsInLog = 0;
287 | };
288 | FD10A7F022414F080027D42C /* Start Packager */ = {
289 | isa = PBXShellScriptBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | );
293 | inputFileListPaths = (
294 | );
295 | inputPaths = (
296 | );
297 | name = "Start Packager";
298 | outputFileListPaths = (
299 | );
300 | outputPaths = (
301 | );
302 | runOnlyForDeploymentPostprocessing = 0;
303 | shellPath = /bin/sh;
304 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
305 | showEnvVarsInLog = 0;
306 | };
307 | /* End PBXShellScriptBuildPhase section */
308 |
309 | /* Begin PBXSourcesBuildPhase section */
310 | 13B07F871A680F5B00A75B9A /* Sources */ = {
311 | isa = PBXSourcesBuildPhase;
312 | buildActionMask = 2147483647;
313 | files = (
314 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
315 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
316 | );
317 | runOnlyForDeploymentPostprocessing = 0;
318 | };
319 | /* End PBXSourcesBuildPhase section */
320 |
321 | /* Begin PBXVariantGroup section */
322 | 8C6CAAFD26C17DFC006835D3 /* LaunchScreen.storyboard */ = {
323 | isa = PBXVariantGroup;
324 | children = (
325 | 8C6CAAFC26C17DFC006835D3 /* Base */,
326 | );
327 | name = LaunchScreen.storyboard;
328 | path = FaceApi;
329 | sourceTree = "";
330 | };
331 | /* End PBXVariantGroup section */
332 |
333 | /* Begin XCBuildConfiguration section */
334 | 13B07F941A680F5B00A75B9A /* Debug */ = {
335 | isa = XCBuildConfiguration;
336 | baseConfigurationReference = 093A085EA63AAF5F29293E44 /* Pods-FaceApi.debug.xcconfig */;
337 | buildSettings = {
338 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
339 | CLANG_ENABLE_MODULES = YES;
340 | CURRENT_PROJECT_VERSION = 1;
341 | ENABLE_BITCODE = NO;
342 | INFOPLIST_FILE = FaceApi/Info.plist;
343 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
344 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
345 | OTHER_LDFLAGS = (
346 | "$(inherited)",
347 | "-ObjC",
348 | "-lc++",
349 | );
350 | PRODUCT_BUNDLE_IDENTIFIER = regula.FaceSDKSample;
351 | PRODUCT_NAME = FaceApi;
352 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
353 | SWIFT_VERSION = 5.0;
354 | VERSIONING_SYSTEM = "apple-generic";
355 | };
356 | name = Debug;
357 | };
358 | 13B07F951A680F5B00A75B9A /* Release */ = {
359 | isa = XCBuildConfiguration;
360 | baseConfigurationReference = CB82E17B857594B755F192CC /* Pods-FaceApi.release.xcconfig */;
361 | buildSettings = {
362 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
363 | CLANG_ENABLE_MODULES = YES;
364 | CURRENT_PROJECT_VERSION = 1;
365 | INFOPLIST_FILE = FaceApi/Info.plist;
366 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
367 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
368 | OTHER_LDFLAGS = (
369 | "$(inherited)",
370 | "-ObjC",
371 | "-lc++",
372 | );
373 | PRODUCT_BUNDLE_IDENTIFIER = regula.FaceSDKSample;
374 | PRODUCT_NAME = FaceApi;
375 | SWIFT_VERSION = 5.0;
376 | VERSIONING_SYSTEM = "apple-generic";
377 | };
378 | name = Release;
379 | };
380 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
381 | isa = XCBuildConfiguration;
382 | buildSettings = {
383 | ALWAYS_SEARCH_USER_PATHS = NO;
384 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
386 | CLANG_CXX_LIBRARY = "libc++";
387 | CLANG_ENABLE_MODULES = YES;
388 | CLANG_ENABLE_OBJC_ARC = YES;
389 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
390 | CLANG_WARN_BOOL_CONVERSION = YES;
391 | CLANG_WARN_COMMA = YES;
392 | CLANG_WARN_CONSTANT_CONVERSION = YES;
393 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
394 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
395 | CLANG_WARN_EMPTY_BODY = YES;
396 | CLANG_WARN_ENUM_CONVERSION = YES;
397 | CLANG_WARN_INFINITE_RECURSION = YES;
398 | CLANG_WARN_INT_CONVERSION = YES;
399 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
400 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
401 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
403 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
404 | CLANG_WARN_STRICT_PROTOTYPES = YES;
405 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
406 | CLANG_WARN_UNREACHABLE_CODE = YES;
407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
408 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
409 | COPY_PHASE_STRIP = NO;
410 | ENABLE_STRICT_OBJC_MSGSEND = YES;
411 | ENABLE_TESTABILITY = YES;
412 | GCC_C_LANGUAGE_STANDARD = gnu99;
413 | GCC_DYNAMIC_NO_PIC = NO;
414 | GCC_NO_COMMON_BLOCKS = YES;
415 | GCC_OPTIMIZATION_LEVEL = 0;
416 | GCC_PREPROCESSOR_DEFINITIONS = (
417 | "DEBUG=1",
418 | "$(inherited)",
419 | );
420 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
421 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
422 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
423 | GCC_WARN_UNDECLARED_SELECTOR = YES;
424 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
425 | GCC_WARN_UNUSED_FUNCTION = YES;
426 | GCC_WARN_UNUSED_VARIABLE = YES;
427 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
428 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
429 | LIBRARY_SEARCH_PATHS = (
430 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
431 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
432 | "\"$(inherited)\"",
433 | );
434 | MTL_ENABLE_DEBUG_INFO = YES;
435 | ONLY_ACTIVE_ARCH = YES;
436 | SDKROOT = iphoneos;
437 | };
438 | name = Debug;
439 | };
440 | 83CBBA211A601CBA00E9B192 /* Release */ = {
441 | isa = XCBuildConfiguration;
442 | buildSettings = {
443 | ALWAYS_SEARCH_USER_PATHS = NO;
444 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
445 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
446 | CLANG_CXX_LIBRARY = "libc++";
447 | CLANG_ENABLE_MODULES = YES;
448 | CLANG_ENABLE_OBJC_ARC = YES;
449 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
450 | CLANG_WARN_BOOL_CONVERSION = YES;
451 | CLANG_WARN_COMMA = YES;
452 | CLANG_WARN_CONSTANT_CONVERSION = YES;
453 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
454 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
455 | CLANG_WARN_EMPTY_BODY = YES;
456 | CLANG_WARN_ENUM_CONVERSION = YES;
457 | CLANG_WARN_INFINITE_RECURSION = YES;
458 | CLANG_WARN_INT_CONVERSION = YES;
459 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
460 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
461 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
462 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
463 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
464 | CLANG_WARN_STRICT_PROTOTYPES = YES;
465 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
466 | CLANG_WARN_UNREACHABLE_CODE = YES;
467 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
468 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
469 | COPY_PHASE_STRIP = YES;
470 | ENABLE_NS_ASSERTIONS = NO;
471 | ENABLE_STRICT_OBJC_MSGSEND = YES;
472 | GCC_C_LANGUAGE_STANDARD = gnu99;
473 | GCC_NO_COMMON_BLOCKS = YES;
474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
476 | GCC_WARN_UNDECLARED_SELECTOR = YES;
477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
478 | GCC_WARN_UNUSED_FUNCTION = YES;
479 | GCC_WARN_UNUSED_VARIABLE = YES;
480 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
481 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
482 | LIBRARY_SEARCH_PATHS = (
483 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
484 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
485 | "\"$(inherited)\"",
486 | );
487 | MTL_ENABLE_DEBUG_INFO = NO;
488 | SDKROOT = iphoneos;
489 | VALIDATE_PRODUCT = YES;
490 | };
491 | name = Release;
492 | };
493 | /* End XCBuildConfiguration section */
494 |
495 | /* Begin XCConfigurationList section */
496 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "FaceApi" */ = {
497 | isa = XCConfigurationList;
498 | buildConfigurations = (
499 | 13B07F941A680F5B00A75B9A /* Debug */,
500 | 13B07F951A680F5B00A75B9A /* Release */,
501 | );
502 | defaultConfigurationIsVisible = 0;
503 | defaultConfigurationName = Release;
504 | };
505 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "FaceApi" */ = {
506 | isa = XCConfigurationList;
507 | buildConfigurations = (
508 | 83CBBA201A601CBA00E9B192 /* Debug */,
509 | 83CBBA211A601CBA00E9B192 /* Release */,
510 | );
511 | defaultConfigurationIsVisible = 0;
512 | defaultConfigurationName = Release;
513 | };
514 | /* End XCConfigurationList section */
515 | };
516 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
517 | }
518 |
--------------------------------------------------------------------------------
/example/ios/FaceApi.xcodeproj/xcshareddata/xcschemes/FaceApi-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/example/ios/FaceApi.xcodeproj/xcshareddata/xcschemes/FaceApi.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/example/ios/FaceApi.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/FaceApi.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/FaceApi/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : UIResponder
5 |
6 | @property (nonatomic, strong) UIWindow *window;
7 |
8 | @end
9 |
--------------------------------------------------------------------------------
/example/ios/FaceApi/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 | #import
5 | #import
6 |
7 | #ifdef FB_SONARKIT_ENABLED
8 | #import
9 | #import
10 | #import
11 | #import
12 | #import
13 | #import
14 |
15 | static void InitializeFlipper(UIApplication *application) {
16 | FlipperClient *client = [FlipperClient sharedClient];
17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
20 | [client addPlugin:[FlipperKitReactPlugin new]];
21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
22 | [client start];
23 | }
24 | #endif
25 |
26 | @implementation AppDelegate
27 |
28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
29 | {
30 | #ifdef FB_SONARKIT_ENABLED
31 | InitializeFlipper(application);
32 | #endif
33 |
34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
36 | moduleName:@"FaceApi"
37 | initialProperties:nil];
38 |
39 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
40 |
41 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
42 | UIViewController *rootViewController = [UIViewController new];
43 | rootViewController.view = rootView;
44 | self.window.rootViewController = rootViewController;
45 | [self.window makeKeyAndVisible];
46 | return YES;
47 | }
48 |
49 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
50 | {
51 | #if DEBUG
52 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
53 | #else
54 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
55 | #endif
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/example/ios/FaceApi/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/example/ios/FaceApi/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/example/ios/FaceApi/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/FaceApi/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | FaceApi
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 | NSExceptionDomains
32 |
33 | localhost
34 |
35 | NSExceptionAllowsInsecureHTTPLoads
36 |
37 |
38 |
39 |
40 | NSCameraUsageDescription
41 |
42 | NSLocationWhenInUseUsageDescription
43 |
44 | UILaunchStoryboardName
45 | LaunchScreen
46 | UIRequiredDeviceCapabilities
47 |
48 | armv7
49 |
50 | UISupportedInterfaceOrientations
51 |
52 | UIInterfaceOrientationPortrait
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 | UIViewControllerBasedStatusBarAppearance
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/example/ios/FaceApi/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | platform :ios, '11.0'
5 |
6 | target 'FaceApi' do
7 | config = use_native_modules!
8 |
9 | use_react_native!(:path => config["reactNativePath"])
10 |
11 | post_install do |installer|
12 | installer.pods_project.targets.each do |target|
13 | if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
14 | target.build_configurations.each do |config|
15 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/example/metro.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const folders = [
3 | path.resolve(path.join(__dirname, './node_modules'))
4 | ];
5 | module.exports = {
6 | transformer: {
7 | getTransformOptions: async () => ({
8 | transform: {
9 | experimentalImportSupport: false,
10 | inlineRequires: true,
11 | },
12 | }),
13 | },
14 | resolver: {
15 | nodeModulesPaths: folders
16 | },
17 | watchFolders: folders,
18 | };
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "FaceApi",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "start": "react-native start",
9 | "test": "jest",
10 | "lint": "eslint .",
11 | "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
12 | },
13 | "dependencies": {
14 | "react": "17.0.2",
15 | "react-native": "^0.67.0",
16 | "@regulaforensics/react-native-face-api": "5.1.6",
17 | "@regulaforensics/react-native-face-core": "5.1.0",
18 | "react-native-image-picker": "^4.1.2"
19 | },
20 | "devDependencies": {
21 | "@babel/core": "7.16.0",
22 | "@babel/runtime": "7.16.0",
23 | "@react-native-community/eslint-config": "2.0.0",
24 | "babel-jest": "26.6.3",
25 | "eslint": "7.14.0",
26 | "jest": "26.6.3",
27 | "metro-react-native-babel-preset": "^0.66.2",
28 | "react-test-renderer": "17.0.2"
29 | },
30 | "jest": {
31 | "preset": "react-native"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | import { NativeModules } from 'react-native'
2 | export const { RNFaceApi } = NativeModules
3 |
4 | export class FaceCaptureException {
5 | errorCode?: string
6 | message?: string
7 |
8 | static fromJson(jsonObject?: any): FaceCaptureException | undefined {
9 | if (jsonObject == null || jsonObject == undefined) return undefined
10 | const result = new FaceCaptureException
11 |
12 | result.errorCode = jsonObject["errorCode"]
13 | result.message = jsonObject["message"]
14 |
15 | return result
16 | }
17 | }
18 |
19 | export class InitException {
20 | errorCode?: string
21 | message?: string
22 |
23 | static fromJson(jsonObject?: any): InitException | undefined {
24 | if (jsonObject == null || jsonObject == undefined) return undefined
25 | const result = new InitException
26 |
27 | result.errorCode = jsonObject["errorCode"]
28 | result.message = jsonObject["message"]
29 |
30 | return result
31 | }
32 | }
33 |
34 | export class LivenessErrorException {
35 | errorCode?: string
36 | underlyingException?: LivenessBackendException
37 | message?: string
38 |
39 | static fromJson(jsonObject?: any): LivenessErrorException | undefined {
40 | if (jsonObject == null || jsonObject == undefined) return undefined
41 | const result = new LivenessErrorException
42 |
43 | result.errorCode = jsonObject["errorCode"]
44 | result.underlyingException = LivenessBackendException.fromJson(jsonObject["underlyingException"])
45 | result.message = jsonObject["message"]
46 |
47 | return result
48 | }
49 | }
50 |
51 | export class LivenessBackendException {
52 | errorCode?: number
53 | message?: string
54 |
55 | static fromJson(jsonObject?: any): LivenessBackendException | undefined {
56 | if (jsonObject == null || jsonObject == undefined) return undefined
57 | const result = new LivenessBackendException
58 |
59 | result.errorCode = jsonObject["errorCode"]
60 | result.message = jsonObject["message"]
61 |
62 | return result
63 | }
64 | }
65 |
66 | export class MatchFacesException {
67 | errorCode?: string
68 | message?: string
69 |
70 | static fromJson(jsonObject?: any): MatchFacesException | undefined {
71 | if (jsonObject == null || jsonObject == undefined) return undefined
72 | const result = new MatchFacesException
73 |
74 | result.errorCode = jsonObject["errorCode"]
75 | result.message = jsonObject["message"]
76 |
77 | return result
78 | }
79 | }
80 |
81 | export class FaceCaptureResponse {
82 | exception?: FaceCaptureException
83 | image?: Image
84 |
85 | static fromJson(jsonObject?: any): FaceCaptureResponse | undefined {
86 | if (jsonObject == null || jsonObject == undefined) return undefined
87 | const result = new FaceCaptureResponse
88 |
89 | result.exception = FaceCaptureException.fromJson(jsonObject["exception"])
90 | result.image = Image.fromJson(jsonObject["image"])
91 |
92 | return result
93 | }
94 | }
95 |
96 | export class LivenessResponse {
97 | bitmap?: string
98 | liveness?: string
99 | sessionId?: string
100 | transactionId?: string
101 | exception?: LivenessErrorException
102 |
103 | static fromJson(jsonObject?: any): LivenessResponse | undefined {
104 | if (jsonObject == null || jsonObject == undefined) return undefined
105 | const result = new LivenessResponse
106 |
107 | result.bitmap = jsonObject["bitmap"]
108 | result.liveness = jsonObject["liveness"]
109 | result.sessionId = jsonObject["sessionId"]
110 | result.transactionId = jsonObject["transactionId"]
111 | result.exception = LivenessErrorException.fromJson(jsonObject["exception"])
112 |
113 | return result
114 | }
115 | }
116 |
117 | export class MatchFacesResponse {
118 | exception?: MatchFacesException
119 | detections?: MatchFacesDetection[]
120 | results?: MatchFacesComparedFacesPair[]
121 |
122 | static fromJson(jsonObject?: any): MatchFacesResponse | undefined {
123 | if (jsonObject == null || jsonObject == undefined) return undefined
124 | const result = new MatchFacesResponse
125 |
126 | result.exception = MatchFacesException.fromJson(jsonObject["exception"])
127 | result.detections = []
128 | if (jsonObject["detections"] != null) {
129 | for (const i in jsonObject["detections"]) {
130 | const item = MatchFacesDetection.fromJson(jsonObject["detections"][i])
131 | if (item != undefined)
132 | result.detections.push(item)
133 | }
134 | }
135 | result.results = []
136 | if (jsonObject["results"] != null) {
137 | for (const i in jsonObject["results"]) {
138 | const item = MatchFacesComparedFacesPair.fromJson(jsonObject["results"][i])
139 | if (item != undefined)
140 | result.results.push(item)
141 | }
142 | }
143 |
144 | return result
145 | }
146 | }
147 |
148 | export class Image {
149 | imageType?: number
150 | bitmap?: string
151 | tag?: string
152 | imageData?: any[]
153 |
154 | static fromJson(jsonObject?: any): Image | undefined {
155 | if (jsonObject == null || jsonObject == undefined) return undefined
156 | const result = new Image
157 |
158 | result.imageType = jsonObject["imageType"]
159 | result.bitmap = jsonObject["bitmap"]
160 | result.tag = jsonObject["tag"]
161 | result.imageData = []
162 | if (jsonObject["imageData"] != null) {
163 | for (const i in jsonObject["imageData"]) {
164 | result.imageData.push(jsonObject["imageData"][i])
165 | }
166 | }
167 |
168 | return result
169 | }
170 | }
171 |
172 | export class MatchFacesRequest {
173 | images?: MatchFacesImage[]
174 | customMetadata?: any
175 | thumbnails?: boolean
176 |
177 | static fromJson(jsonObject?: any): MatchFacesRequest | undefined {
178 | if (jsonObject == null || jsonObject == undefined) return undefined
179 | const result = new MatchFacesRequest
180 |
181 | result.images = []
182 | if (jsonObject["images"] != null) {
183 | for (const i in jsonObject["images"]) {
184 | const item = MatchFacesImage.fromJson(jsonObject["images"][i])
185 | if (item != undefined)
186 | result.images.push(item)
187 | }
188 | }
189 | result.customMetadata = jsonObject["customMetadata"]
190 | result.thumbnails = jsonObject["thumbnails"]
191 |
192 | return result
193 | }
194 | }
195 |
196 | export class MatchFacesImage {
197 | imageType?: number
198 | detectAll?: boolean
199 | bitmap?: string
200 | identifier?: string
201 |
202 | static fromJson(jsonObject?: any): MatchFacesImage | undefined {
203 | if (jsonObject == null || jsonObject == undefined) return undefined
204 | const result = new MatchFacesImage
205 |
206 | result.imageType = jsonObject["imageType"]
207 | result.detectAll = jsonObject["detectAll"]
208 | result.bitmap = jsonObject["bitmap"]
209 | result.identifier = jsonObject["identifier"]
210 |
211 | return result
212 | }
213 | }
214 |
215 | export class MatchFacesComparedFacesPair {
216 | first?: MatchFacesComparedFace
217 | second?: MatchFacesComparedFace
218 | similarity?: number
219 | score?: number
220 | exception?: MatchFacesException
221 |
222 | static fromJson(jsonObject?: any): MatchFacesComparedFacesPair | undefined {
223 | if (jsonObject == null || jsonObject == undefined) return undefined
224 | const result = new MatchFacesComparedFacesPair
225 |
226 | result.first = MatchFacesComparedFace.fromJson(jsonObject["first"])
227 | result.second = MatchFacesComparedFace.fromJson(jsonObject["second"])
228 | result.similarity = jsonObject["similarity"]
229 | result.score = jsonObject["score"]
230 | result.exception = MatchFacesException.fromJson(jsonObject["exception"])
231 |
232 | return result
233 | }
234 | }
235 |
236 | export class MatchFacesComparedFace {
237 | face?: MatchFacesDetectionFace
238 | image?: MatchFacesImage
239 | faceIndex?: number
240 | imageIndex?: number
241 |
242 | static fromJson(jsonObject?: any): MatchFacesComparedFace | undefined {
243 | if (jsonObject == null || jsonObject == undefined) return undefined
244 | const result = new MatchFacesComparedFace
245 |
246 | result.face = MatchFacesDetectionFace.fromJson(jsonObject["face"])
247 | result.image = MatchFacesImage.fromJson(jsonObject["image"])
248 | result.faceIndex = jsonObject["faceIndex"]
249 | result.imageIndex = jsonObject["imageIndex"]
250 |
251 | return result
252 | }
253 | }
254 |
255 | export class MatchFacesDetectionFace {
256 | faceIndex?: number
257 | landmarks?: Point[]
258 | faceRect?: Rect
259 | rotationAngle?: number
260 | thumbnail?: string
261 |
262 | static fromJson(jsonObject?: any): MatchFacesDetectionFace | undefined {
263 | if (jsonObject == null || jsonObject == undefined) return undefined
264 | const result = new MatchFacesDetectionFace
265 |
266 | result.faceIndex = jsonObject["faceIndex"]
267 | result.landmarks = []
268 | if (jsonObject["landmarks"] != null) {
269 | for (const i in jsonObject["landmarks"]) {
270 | const item = Point.fromJson(jsonObject["landmarks"][i])
271 | if (item != undefined)
272 | result.landmarks.push(item)
273 | }
274 | }
275 | result.faceRect = Rect.fromJson(jsonObject["faceRect"])
276 | result.rotationAngle = jsonObject["rotationAngle"]
277 | result.thumbnail = jsonObject["thumbnail"]
278 |
279 | return result
280 | }
281 | }
282 |
283 | export class MatchFacesDetection {
284 | image?: MatchFacesImage
285 | imageIndex?: number
286 | faces?: MatchFacesDetectionFace[]
287 | exception?: MatchFacesException
288 |
289 | static fromJson(jsonObject?: any): MatchFacesDetection | undefined {
290 | if (jsonObject == null || jsonObject == undefined) return undefined
291 | const result = new MatchFacesDetection
292 |
293 | result.image = MatchFacesImage.fromJson(jsonObject["image"])
294 | result.imageIndex = jsonObject["imageIndex"]
295 | result.faces = []
296 | if (jsonObject["faces"] != null) {
297 | for (const i in jsonObject["faces"]) {
298 | const item = MatchFacesDetectionFace.fromJson(jsonObject["faces"][i])
299 | if (item != undefined)
300 | result.faces.push(item)
301 | }
302 | }
303 | result.exception = MatchFacesException.fromJson(jsonObject["exception"])
304 |
305 | return result
306 | }
307 | }
308 |
309 | export class Point {
310 | x?: number
311 | y?: number
312 |
313 | static fromJson(jsonObject?: any): Point | undefined {
314 | if (jsonObject == null || jsonObject == undefined) return undefined
315 | const result = new Point
316 |
317 | result.x = jsonObject["x"]
318 | result.y = jsonObject["y"]
319 |
320 | return result
321 | }
322 | }
323 |
324 | export class Rect {
325 | bottom?: number
326 | top?: number
327 | left?: number
328 | right?: number
329 |
330 | static fromJson(jsonObject?: any): Rect | undefined {
331 | if (jsonObject == null || jsonObject == undefined) return undefined
332 | const result = new Rect
333 |
334 | result.bottom = jsonObject["bottom"]
335 | result.top = jsonObject["top"]
336 | result.left = jsonObject["left"]
337 | result.right = jsonObject["right"]
338 |
339 | return result
340 | }
341 | }
342 |
343 | export class MatchFacesSimilarityThresholdSplit {
344 | matchedFaces?: MatchFacesComparedFacesPair[]
345 | unmatchedFaces?: MatchFacesComparedFacesPair[]
346 |
347 | static fromJson(jsonObject?: any): MatchFacesSimilarityThresholdSplit | undefined {
348 | if (jsonObject == null || jsonObject == undefined) return undefined
349 | const result = new MatchFacesSimilarityThresholdSplit
350 |
351 | result.matchedFaces = []
352 | if (jsonObject["matchedFaces"] != null) {
353 | for (const i in jsonObject["matchedFaces"]) {
354 | const item = MatchFacesComparedFacesPair.fromJson(jsonObject["matchedFaces"][i])
355 | if (item != undefined)
356 | result.matchedFaces.push(item)
357 | }
358 | }
359 | result.unmatchedFaces = []
360 | if (jsonObject["unmatchedFaces"] != null) {
361 | for (const i in jsonObject["unmatchedFaces"]) {
362 | const item = MatchFacesComparedFacesPair.fromJson(jsonObject["unmatchedFaces"][i])
363 | if (item != undefined)
364 | result.unmatchedFaces.push(item)
365 | }
366 | }
367 |
368 | return result
369 | }
370 | }
371 |
372 | export class DetectFacesRequest {
373 | scenario?: string
374 | image?: string
375 | configuration?: DetectFacesConfiguration
376 |
377 | static fromJson(jsonObject?: any): DetectFacesRequest | undefined {
378 | if (jsonObject == null || jsonObject == undefined) return undefined
379 | const result = new DetectFacesRequest
380 |
381 | result.scenario = jsonObject["scenario"]
382 | result.image = jsonObject["image"]
383 | result.configuration = DetectFacesConfiguration.fromJson(jsonObject["configuration"])
384 |
385 | return result
386 | }
387 | }
388 |
389 | export class DetectFacesConfiguration {
390 | attributes?: string[]
391 | customQuality?: ImageQualityCharacteristic[]
392 | outputImageParams?: OutputImageParams
393 | onlyCentralFace?: boolean
394 |
395 | static fromJson(jsonObject?: any): DetectFacesConfiguration | undefined {
396 | if (jsonObject == null || jsonObject == undefined) return undefined
397 | const result = new DetectFacesConfiguration
398 |
399 | result.attributes = []
400 | if (jsonObject["attributes"] != null) {
401 | for (const i in jsonObject["attributes"]) {
402 | result.attributes.push(jsonObject["attributes"][i])
403 | }
404 | }
405 | result.customQuality = []
406 | if (jsonObject["customQuality"] != null) {
407 | for (const i in jsonObject["customQuality"]) {
408 | const item = ImageQualityCharacteristic.fromJson(jsonObject["customQuality"][i])
409 | if (item != undefined)
410 | result.customQuality.push(item)
411 | }
412 | }
413 | result.outputImageParams = OutputImageParams.fromJson(jsonObject["outputImageParams"])
414 | result.onlyCentralFace = jsonObject["onlyCentralFace"]
415 |
416 | return result
417 | }
418 | }
419 |
420 | export class OutputImageParams {
421 | backgroundColor?: string
422 | crop?: OutputImageCrop
423 |
424 | static fromJson(jsonObject?: any): OutputImageParams | undefined {
425 | if (jsonObject == null || jsonObject == undefined) return undefined
426 | const result = new OutputImageParams
427 |
428 | result.backgroundColor = jsonObject["backgroundColor"]
429 | result.crop = OutputImageCrop.fromJson(jsonObject["crop"])
430 |
431 | return result
432 | }
433 | }
434 |
435 | export class OutputImageCrop {
436 | type?: number
437 | size?: Size
438 | padColor?: string
439 | returnOriginalRect?: boolean
440 |
441 | static fromJson(jsonObject?: any): OutputImageCrop | undefined {
442 | if (jsonObject == null || jsonObject == undefined) return undefined
443 | const result = new OutputImageCrop
444 |
445 | result.type = jsonObject["type"]
446 | result.size = Size.fromJson(jsonObject["size"])
447 | result.padColor = jsonObject["padColor"]
448 | result.returnOriginalRect = jsonObject["returnOriginalRect"]
449 |
450 | return result
451 | }
452 | }
453 |
454 | export class ImageQualityCharacteristic {
455 | characteristicName?: string
456 | imageQualityGroup?: number
457 | recommendedRange?: ImageQualityRange
458 | customRange?: ImageQualityRange
459 |
460 | static fromJson(jsonObject?: any): ImageQualityCharacteristic | undefined {
461 | if (jsonObject == null || jsonObject == undefined) return undefined
462 | const result = new ImageQualityCharacteristic
463 |
464 | result.characteristicName = jsonObject["characteristicName"]
465 | result.imageQualityGroup = jsonObject["imageQualityGroup"]
466 | result.recommendedRange = ImageQualityRange.fromJson(jsonObject["recommendedRange"])
467 | result.customRange = ImageQualityRange.fromJson(jsonObject["customRange"])
468 |
469 | return result
470 | }
471 | }
472 |
473 | export class ImageQualityRange {
474 | min?: number
475 | max?: number
476 |
477 | static fromJson(jsonObject?: any): ImageQualityRange | undefined {
478 | if (jsonObject == null || jsonObject == undefined) return undefined
479 | const result = new ImageQualityRange
480 |
481 | result.min = jsonObject["min"]
482 | result.max = jsonObject["max"]
483 |
484 | return result
485 | }
486 | }
487 |
488 | export class Size {
489 | width?: number
490 | height?: number
491 |
492 | static fromJson(jsonObject?: any): Size | undefined {
493 | if (jsonObject == null || jsonObject == undefined) return undefined
494 | const result = new Size
495 |
496 | result.width = jsonObject["width"]
497 | result.height = jsonObject["height"]
498 |
499 | return result
500 | }
501 | }
502 |
503 | export class DetectFacesResponse {
504 | detection?: DetectFaceResult
505 | scenario?: string
506 | error?: DetectFacesErrorException
507 | allDetections?: DetectFaceResult[]
508 |
509 | static fromJson(jsonObject?: any): DetectFacesResponse | undefined {
510 | if (jsonObject == null || jsonObject == undefined) return undefined
511 | const result = new DetectFacesResponse
512 |
513 | result.detection = DetectFaceResult.fromJson(jsonObject["detection"])
514 | result.scenario = jsonObject["scenario"]
515 | result.error = DetectFacesErrorException.fromJson(jsonObject["error"])
516 | result.allDetections = []
517 | if (jsonObject["allDetections"] != null) {
518 | for (const i in jsonObject["allDetections"]) {
519 | const item = DetectFaceResult.fromJson(jsonObject["allDetections"][i])
520 | if (item != undefined)
521 | result.allDetections.push(item)
522 | }
523 | }
524 |
525 | return result
526 | }
527 | }
528 |
529 | export class DetectFacesErrorException {
530 | errorCode?: string
531 | underlyingException?: DetectFacesBackendException
532 | message?: string
533 |
534 | static fromJson(jsonObject?: any): DetectFacesErrorException | undefined {
535 | if (jsonObject == null || jsonObject == undefined) return undefined
536 | const result = new DetectFacesErrorException
537 |
538 | result.errorCode = jsonObject["errorCode"]
539 | result.underlyingException = DetectFacesBackendException.fromJson(jsonObject["underlyingException"])
540 | result.message = jsonObject["message"]
541 |
542 | return result
543 | }
544 | }
545 |
546 | export class DetectFacesBackendException {
547 | errorCode?: number
548 | message?: string
549 |
550 | static fromJson(jsonObject?: any): DetectFacesBackendException | undefined {
551 | if (jsonObject == null || jsonObject == undefined) return undefined
552 | const result = new DetectFacesBackendException
553 |
554 | result.errorCode = jsonObject["errorCode"]
555 | result.message = jsonObject["message"]
556 |
557 | return result
558 | }
559 | }
560 |
561 | export class DetectFaceResult {
562 | quality?: ImageQualityResult[]
563 | attributes?: DetectFacesAttributeResult[]
564 | landmarks?: Point[]
565 | crop?: string
566 | faceRect?: Rect
567 | originalRect?: Rect
568 | isQualityCompliant?: boolean
569 |
570 | static fromJson(jsonObject?: any): DetectFaceResult | undefined {
571 | if (jsonObject == null || jsonObject == undefined) return undefined
572 | const result = new DetectFaceResult
573 |
574 | result.quality = []
575 | if (jsonObject["quality"] != null) {
576 | for (const i in jsonObject["quality"]) {
577 | const item = ImageQualityResult.fromJson(jsonObject["quality"][i])
578 | if (item != undefined)
579 | result.quality.push(item)
580 | }
581 | }
582 | result.attributes = []
583 | if (jsonObject["attributes"] != null) {
584 | for (const i in jsonObject["attributes"]) {
585 | const item = DetectFacesAttributeResult.fromJson(jsonObject["attributes"][i])
586 | if (item != undefined)
587 | result.attributes.push(item)
588 | }
589 | }
590 | result.landmarks = []
591 | if (jsonObject["landmarks"] != null) {
592 | for (const i in jsonObject["landmarks"]) {
593 | const item = Point.fromJson(jsonObject["landmarks"][i])
594 | if (item != undefined)
595 | result.landmarks.push(item)
596 | }
597 | }
598 | result.crop = jsonObject["crop"]
599 | result.faceRect = Rect.fromJson(jsonObject["faceRect"])
600 | result.originalRect = Rect.fromJson(jsonObject["originalRect"])
601 | result.isQualityCompliant = jsonObject["isQualityCompliant"]
602 |
603 | return result
604 | }
605 | }
606 |
607 | export class ImageQualityResult {
608 | name?: string
609 | group?: number
610 | status?: number
611 | range?: ImageQualityRange
612 | value?: number
613 |
614 | static fromJson(jsonObject?: any): ImageQualityResult | undefined {
615 | if (jsonObject == null || jsonObject == undefined) return undefined
616 | const result = new ImageQualityResult
617 |
618 | result.name = jsonObject["name"]
619 | result.group = jsonObject["group"]
620 | result.status = jsonObject["status"]
621 | result.range = ImageQualityRange.fromJson(jsonObject["range"])
622 | result.value = jsonObject["value"]
623 |
624 | return result
625 | }
626 | }
627 |
628 | export class DetectFacesAttributeResult {
629 | attribute?: string
630 | value?: string
631 | range?: ImageQualityRange
632 | confidence?: number
633 |
634 | static fromJson(jsonObject?: any): DetectFacesAttributeResult | undefined {
635 | if (jsonObject == null || jsonObject == undefined) return undefined
636 | const result = new DetectFacesAttributeResult
637 |
638 | result.attribute = jsonObject["attribute"]
639 | result.value = jsonObject["value"]
640 | result.range = ImageQualityRange.fromJson(jsonObject["range"])
641 | result.confidence = jsonObject["confidence"]
642 |
643 | return result
644 | }
645 | }
646 |
647 | export const ImageQualityGroupName = {
648 | IMAGE_CHARACTERISTICS: 1,
649 | HEAD_SIZE_AND_POSITION: 2,
650 | FACE_QUALITY: 3,
651 | EYES_CHARACTERISTICS: 4,
652 | SHADOWS_AND_LIGHTNING: 5,
653 | POSE_AND_EXPRESSION: 6,
654 | HEAD_OCCLUSION: 7,
655 | BACKGROUND: 8,
656 | UNKNOWN: 9,
657 | }
658 |
659 | export const DetectFacesErrorCode = {
660 | IMAGE_EMPTY: "IMAGE_EMPTY",
661 | FR_FACE_NOT_DETECTED: "FR_FACE_NOT_DETECTED",
662 | FACER_NO_LICENSE: "FACER_NO_LICENSE",
663 | FACER_IS_NOT_INITIALIZED: "FACER_IS_NOT_INITIALIZED",
664 | FACER_COMMAND_IS_NOT_SUPPORTED: "FACER_COMMAND_IS_NOT_SUPPORTED",
665 | FACER_COMMAND_PARAMS_READ_ERROR: "FACER_COMMAND_PARAMS_READ_ERROR",
666 | PROCESSING_FAILED: "PROCESSING_FAILED",
667 | REQUEST_FAILED: "REQUEST_FAILED",
668 | API_CALL_FAILED: "API_CALL_FAILED",
669 | }
670 |
671 | export const InitErrorCode = {
672 | IN_PROGRESS_ALREADY: "IN_PROGRESS_ALREADY",
673 | CONTEXT_IS_NULL: "CONTEXT_IS_NULL",
674 | MISSING_CORE: "MISSING_CORE",
675 | INTERNAL_CORE_ERROR: "INTERNAL_CORE_ERROR",
676 | }
677 |
678 | export const LivenessStatus = {
679 | PASSED: "PASSED",
680 | UNKNOWN: "UNKNOWN",
681 | }
682 |
683 | export const CameraErrorCode = {
684 | CAMERA_NOT_AVAILABLE: "CAMERA_NOT_AVAILABLE",
685 | CAMERA_NO_PERMISSION: "CAMERA_NO_PERMISSION",
686 | }
687 |
688 | export const LivenessErrorCode = {
689 | CONTEXT_IS_NULL: "CONTEXT_IS_NULL",
690 | IN_PROGRESS_ALREADY: "IN_PROGRESS_ALREADY",
691 | ZOOM_NOT_SUPPORTED: "ZOOM_NOT_SUPPORTED",
692 | NO_LICENSE: "NO_LICENSE",
693 | CANCELLED: "CANCELLED",
694 | PROCESSING_TIMEOUT: "PROCESSING_TIMEOUT",
695 | API_CALL_FAILED: "API_CALL_FAILED",
696 | PROCESSING_FAILED: "PROCESSING_FAILED",
697 | NOT_INITIALIZED: "NOT_INITIALIZED",
698 | CAMERA_NO_PERMISSION: "CAMERA_NO_PERMISSION",
699 | CAMERA_NOT_AVAILABLE: "CAMERA_NOT_AVAILABLE",
700 | PROCESSING_FRAME_FAILED: "PROCESSING_FRAME_FAILED",
701 | }
702 |
703 | export const DetectFacesBackendErrorCode = {
704 | FR_FACE_NOT_DETECTED: 2,
705 | FACER_NO_LICENSE: 200,
706 | FACER_IS_NOT_INITIALIZED: 201,
707 | FACER_COMMAND_IS_NOT_SUPPORTED: 202,
708 | FACER_COMMAND_PARAMS_READ_ERROR: 203,
709 | UNDEFINED: -1,
710 | }
711 |
712 | export const MatchFacesErrorCode = {
713 | IMAGE_EMPTY: "IMAGE_EMPTY",
714 | FACE_NOT_DETECTED: "FACE_NOT_DETECTED",
715 | LANDMARKS_NOT_DETECTED: "LANDMARKS_NOT_DETECTED",
716 | FACE_ALIGNER_FAILED: "FACE_ALIGNER_FAILED",
717 | DESCRIPTOR_EXTRACTOR_ERROR: "DESCRIPTOR_EXTRACTOR_ERROR",
718 | NO_LICENSE: "NO_LICENSE",
719 | IMAGES_COUNT_LIMIT_EXCEEDED: "IMAGES_COUNT_LIMIT_EXCEEDED",
720 | API_CALL_FAILED: "API_CALL_FAILED",
721 | PROCESSING_FAILED: "PROCESSING_FAILED",
722 | }
723 |
724 | export const ImageQualityCharacteristicName = {
725 | IMAGE_WIDTH: "ImageWidth",
726 | IMAGE_HEIGHT: "ImageHeight",
727 | IMAGE_WIDTH_TO_HEIGHT: "ImageWidthToHeight",
728 | IMAGE_CHANNELS_NUMBER: "ImageChannelsNumber",
729 | PADDING_RATIO: "PaddingRatio",
730 | FACE_MID_POINT_HORIZONTAL_POSITION: "FaceMidPointHorizontalPosition",
731 | FACE_MID_POINT_VERTICAL_POSITION: "FaceMidPointVerticalPosition",
732 | HEAD_WIDTH_RATIO: "HeadWidthRatio",
733 | HEAD_HEIGHT_RATIO: "HeadHeightRatio",
734 | EYES_DISTANCE: "EyesDistance",
735 | YAW: "Yaw",
736 | PITCH: "Pitch",
737 | ROLL: "Roll",
738 | BLUR_LEVEL: "BlurLevel",
739 | NOISE_LEVEL: "NoiseLevel",
740 | UNNATURAL_SKIN_TONE: "UnnaturalSkinTone",
741 | FACE_DYNAMIC_RANGE: "FaceDynamicRange",
742 | EYE_RIGHT_CLOSED: "EyeRightClosed",
743 | EYE_LEFT_CLOSED: "EyeLeftClosed",
744 | EYE_RIGHT_OCCLUDED: "EyeRightOccluded",
745 | EYE_LEFT_OCCLUDED: "EyeLeftOccluded",
746 | EYES_RED: "EyesRed",
747 | EYE_RIGHT_COVERED_WITH_HAIR: "EyeRightCoveredWithHair",
748 | EYE_LEFT_COVERED_WITH_HAIR: "EyeLeftCoveredWithHair",
749 | OFF_GAZE: "OffGaze",
750 | TOO_DARK: "TooDark",
751 | TOO_LIGHT: "TooLight",
752 | FACE_GLARE: "FaceGlare",
753 | SHADOWS_ON_FACE: "ShadowsOnFace",
754 | SHOULDERS_POSE: "ShouldersPose",
755 | EXPRESSION_LEVEL: "ExpressionLevel",
756 | MOUTH_OPEN: "MouthOpen",
757 | SMILE: "Smile",
758 | DARK_GLASSES: "DarkGlasses",
759 | REFLECTION_ON_GLASSES: "ReflectionOnGlasses",
760 | FRAMES_TOO_HEAVY: "FramesTooHeavy",
761 | FACE_OCCLUDED: "FaceOccluded",
762 | HEAD_COVERING: "HeadCovering",
763 | FOREHEAD_COVERING: "ForeheadCovering",
764 | STRONG_MAKEUP: "StrongMakeup",
765 | HEAD_PHONES: "Headphones",
766 | MEDICAL_MASK: "MedicalMask",
767 | BACKGROUND_UNIFORMITY: "BackgroundUniformity",
768 | SHADOWS_ON_BACKGROUND: "ShadowsOnBackground",
769 | OTHER_FACES: "OtherFaces",
770 | BACKGROUND_COLOR_MATCH: "BackgroundColorMatch",
771 | UNKNOWN: "Unknown",
772 | }
773 |
774 | export const DetectFacesScenario = {
775 | CROP_CENTRAL_FACE: "CropCentralFace",
776 | CROP_ALL_FACES: "CropAllFaces",
777 | THUMBNAIL: "Thumbnail",
778 | ATTRIBUTES_ALL: "AttributesAll",
779 | QUALITY_FULL: "QualityFull",
780 | QUALITY_ICAO: "QualityICAO",
781 | QUALITY_VISA_SCHENGEN: "QualityVisaSchengen",
782 | QUALITY_VISA_USA: "QualityVisaUSA",
783 | }
784 |
785 | export const OutputImageCropAspectRatio = {
786 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_3X4: 0,
787 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_4X5: 1,
788 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_2X3: 2,
789 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_1X1: 3,
790 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_7X9: 4,
791 | }
792 |
793 | export const LivenessSkipStep = {
794 | NONE: 0,
795 | START_STEP: 1,
796 | DONE_STEP: 2,
797 | }
798 |
799 | export const ImageQualityResultStatus = {
800 | IMAGE_QUALITY_RESULT_STATUS_FALSE: 0,
801 | IMAGE_QUALITY_RESULT_STATUS_TRUE: 1,
802 | IMAGE_QUALITY_RESULT_STATUS_UNDETERMINED: 2,
803 | }
804 |
805 | export const ImageType = {
806 | PRINTED: 1,
807 | RFID: 2,
808 | LIVE: 3,
809 | DOCUMENT_WITH_LIVE: 4,
810 | EXTERNAL: 5,
811 | GHOST_PORTRAIT: 6,
812 | }
813 |
814 | export const FaceCaptureErrorCode = {
815 | CANCEL: "CANCEL",
816 | CAMERA_NOT_AVAILABLE: "CAMERA_NOT_AVAILABLE",
817 | CAMERA_NO_PERMISSION: "CAMERA_NO_PERMISSION",
818 | IN_PROGRESS_ALREADY: "IN_PROGRESS_ALREADY",
819 | CONTEXT_IS_NULL: "CONTEXT_IS_NULL",
820 | TIMEOUT: "TIMEOUT",
821 | NOT_INITIALIZED: "NOT_INITIALIZED",
822 | }
823 |
824 | export const LivenessBackendErrorCode = {
825 | UNDEFINED: -1,
826 | NO_LICENSE: 200,
827 | LOW_QUALITY: 231,
828 | HIGH_ASYMMETRY: 232,
829 | TRACK_BREAK: 246,
830 | CLOSED_EYES_DETECTED: 230,
831 | FACE_OVER_EMOTIONAL: 233,
832 | SUNGLASSES_DETECTED: 234,
833 | SMALL_AGE: 235,
834 | HEADDRESS_DETECTED: 236,
835 | MEDICINE_MASK_DETECTED: 239,
836 | OCCLUSION_DETECTED: 240,
837 | FOREHEAD_GLASSES_DETECTED: 242,
838 | MOUTH_OPENED: 243,
839 | ART_MASK_DETECTED: 244,
840 | NOT_MATCHED: 237,
841 | IMAGES_COUNT_LIMIT_EXCEEDED: 238,
842 | ELECTRONIC_DEVICE_DETECTED: 245,
843 | WRONG_GEO: 247,
844 | WRONG_OF: 248,
845 | WRONG_VIEW: 249,
846 | }
847 |
848 | export const DetectFacesAttribute = {
849 | AGE: "Age",
850 | EYE_RIGHT: "EyeRight",
851 | EYE_LEFT: "EyeLeft",
852 | EMOTION: "Emotion",
853 | SMILE: "Smile",
854 | GLASSES: "Glasses",
855 | HEAD_COVERING: "HeadCovering",
856 | FOREHEAD_COVERING: "ForeheadCovering",
857 | MOUTH: "Mouth",
858 | MEDICAL_MASK: "MedicalMask",
859 | OCCLUSION: "Occlusion",
860 | STRONG_MAKEUP: "StrongMakeup",
861 | HEADPHONES: "Headphones",
862 | }
863 |
864 | export const Enum = {
865 | ImageQualityGroupName,
866 | DetectFacesErrorCode,
867 | InitErrorCode,
868 | LivenessStatus,
869 | CameraErrorCode,
870 | LivenessErrorCode,
871 | DetectFacesBackendErrorCode,
872 | MatchFacesErrorCode,
873 | ImageQualityCharacteristicName,
874 | DetectFacesScenario,
875 | OutputImageCropAspectRatio,
876 | LivenessSkipStep,
877 | ImageQualityResultStatus,
878 | ImageType,
879 | FaceCaptureErrorCode,
880 | LivenessBackendErrorCode,
881 | DetectFacesAttribute,
882 | }
883 |
884 | export default class FaceSDK {
885 | static getServiceUrl(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
886 | static startLiveness(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
887 | static getFaceSdkVersion(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
888 | static presentFaceCaptureActivity(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
889 | static stopFaceCaptureActivity(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
890 | static init(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
891 | static deinit(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
892 | static isInitialized(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
893 | static stopLivenessProcessing(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
894 | static setRequestHeaders(headers: map, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
895 | static presentFaceCaptureActivityWithConfig(config: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
896 | static startLivenessWithConfig(config: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
897 | static setServiceUrl(url: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
898 | static matchFaces(request: MatchFacesRequest, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
899 | static detectFaces(request: DetectFacesRequest, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
900 | static matchFacesWithConfig(request: MatchFacesRequest, config: object, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
901 | static setLanguage(language: string, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
902 | static matchFacesSimilarityThresholdSplit(faces: string, similarity: number, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
903 | }
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | import { NativeModules } from 'react-native'
2 | export const { RNFaceApi } = NativeModules
3 |
4 | // Classes
5 |
6 | export class FaceCaptureException {
7 | static fromJson(jsonObject) {
8 | if (jsonObject == null) return null
9 | const result = new FaceCaptureException()
10 |
11 | result.errorCode = jsonObject["errorCode"]
12 | result.message = jsonObject["message"]
13 |
14 | return result
15 | }
16 | }
17 |
18 | export class InitException {
19 | static fromJson(jsonObject) {
20 | if (jsonObject == null) return null
21 | const result = new InitException()
22 |
23 | result.errorCode = jsonObject["errorCode"]
24 | result.message = jsonObject["message"]
25 |
26 | return result
27 | }
28 | }
29 |
30 | export class LivenessErrorException {
31 | static fromJson(jsonObject) {
32 | if (jsonObject == null) return null
33 | const result = new LivenessErrorException()
34 |
35 | result.errorCode = jsonObject["errorCode"]
36 | result.underlyingException = LivenessBackendException.fromJson(jsonObject["underlyingException"])
37 | result.message = jsonObject["message"]
38 |
39 | return result
40 | }
41 | }
42 |
43 | export class LivenessBackendException {
44 | static fromJson(jsonObject) {
45 | if (jsonObject == null) return null
46 | const result = new LivenessBackendException()
47 |
48 | result.errorCode = jsonObject["errorCode"]
49 | result.message = jsonObject["message"]
50 |
51 | return result
52 | }
53 | }
54 |
55 | export class MatchFacesException {
56 | static fromJson(jsonObject) {
57 | if (jsonObject == null) return null
58 | const result = new MatchFacesException()
59 |
60 | result.errorCode = jsonObject["errorCode"]
61 | result.message = jsonObject["message"]
62 |
63 | return result
64 | }
65 | }
66 |
67 | export class FaceCaptureResponse {
68 | static fromJson(jsonObject) {
69 | if (jsonObject == null) return null
70 | const result = new FaceCaptureResponse()
71 |
72 | result.exception = FaceCaptureException.fromJson(jsonObject["exception"])
73 | result.image = Image.fromJson(jsonObject["image"])
74 |
75 | return result
76 | }
77 | }
78 |
79 | export class LivenessResponse {
80 | static fromJson(jsonObject) {
81 | if (jsonObject == null) return null
82 | const result = new LivenessResponse()
83 |
84 | result.bitmap = jsonObject["bitmap"]
85 | result.liveness = jsonObject["liveness"]
86 | result.sessionId = jsonObject["sessionId"]
87 | result.transactionId = jsonObject["transactionId"]
88 | result.exception = LivenessErrorException.fromJson(jsonObject["exception"])
89 |
90 | return result
91 | }
92 | }
93 |
94 | export class MatchFacesResponse {
95 | static fromJson(jsonObject) {
96 | if (jsonObject == null) return null
97 | const result = new MatchFacesResponse()
98 |
99 | result.exception = MatchFacesException.fromJson(jsonObject["exception"])
100 | result.detections = []
101 | if (jsonObject["detections"] != null)
102 | for (const i in jsonObject["detections"])
103 | result.detections.push(MatchFacesDetection.fromJson(jsonObject["detections"][i]))
104 | result.results = []
105 | if (jsonObject["results"] != null)
106 | for (const i in jsonObject["results"])
107 | result.results.push(MatchFacesComparedFacesPair.fromJson(jsonObject["results"][i]))
108 |
109 | return result
110 | }
111 | }
112 |
113 | export class Image {
114 | static fromJson(jsonObject) {
115 | if (jsonObject == null) return null
116 | const result = new Image()
117 |
118 | result.imageType = jsonObject["imageType"]
119 | result.bitmap = jsonObject["bitmap"]
120 | result.tag = jsonObject["tag"]
121 | result.imageData = []
122 | if (jsonObject["imageData"] != null)
123 | for (const i in jsonObject["imageData"])
124 | result.imageData.push(jsonObject["imageData"][i])
125 |
126 | return result
127 | }
128 | }
129 |
130 | export class MatchFacesRequest {
131 | static fromJson(jsonObject) {
132 | if (jsonObject == null) return null
133 | const result = new MatchFacesRequest()
134 |
135 | result.images = []
136 | if (jsonObject["images"] != null)
137 | for (const i in jsonObject["images"])
138 | result.images.push(MatchFacesImage.fromJson(jsonObject["images"][i]))
139 | result.customMetadata = jsonObject["customMetadata"]
140 | result.thumbnails = jsonObject["thumbnails"]
141 |
142 | return result
143 | }
144 | }
145 |
146 | export class MatchFacesImage {
147 | static fromJson(jsonObject) {
148 | if (jsonObject == null) return null
149 | const result = new MatchFacesImage()
150 |
151 | result.imageType = jsonObject["imageType"]
152 | result.detectAll = jsonObject["detectAll"]
153 | result.bitmap = jsonObject["bitmap"]
154 | result.identifier = jsonObject["identifier"]
155 |
156 | return result
157 | }
158 | }
159 |
160 | export class MatchFacesComparedFacesPair {
161 | static fromJson(jsonObject) {
162 | if (jsonObject == null) return null
163 | const result = new MatchFacesComparedFacesPair()
164 |
165 | result.first = MatchFacesComparedFace.fromJson(jsonObject["first"])
166 | result.second = MatchFacesComparedFace.fromJson(jsonObject["second"])
167 | result.similarity = jsonObject["similarity"]
168 | result.score = jsonObject["score"]
169 | result.exception = MatchFacesException.fromJson(jsonObject["exception"])
170 |
171 | return result
172 | }
173 | }
174 |
175 | export class MatchFacesComparedFace {
176 | static fromJson(jsonObject) {
177 | if (jsonObject == null) return null
178 | const result = new MatchFacesComparedFace()
179 |
180 | result.face = MatchFacesDetectionFace.fromJson(jsonObject["face"])
181 | result.image = MatchFacesImage.fromJson(jsonObject["image"])
182 | result.faceIndex = jsonObject["faceIndex"]
183 | result.imageIndex = jsonObject["imageIndex"]
184 |
185 | return result
186 | }
187 | }
188 |
189 | export class MatchFacesDetectionFace {
190 | static fromJson(jsonObject) {
191 | if (jsonObject == null) return null
192 | const result = new MatchFacesDetectionFace()
193 |
194 | result.faceIndex = jsonObject["faceIndex"]
195 | result.landmarks = []
196 | if (jsonObject["landmarks"] != null)
197 | for (const i in jsonObject["landmarks"])
198 | result.landmarks.push(Point.fromJson(jsonObject["landmarks"][i]))
199 | result.faceRect = Rect.fromJson(jsonObject["faceRect"])
200 | result.rotationAngle = jsonObject["rotationAngle"]
201 | result.thumbnail = jsonObject["thumbnail"]
202 |
203 | return result
204 | }
205 | }
206 |
207 | export class MatchFacesDetection {
208 | static fromJson(jsonObject) {
209 | if (jsonObject == null) return null
210 | const result = new MatchFacesDetection()
211 |
212 | result.image = MatchFacesImage.fromJson(jsonObject["image"])
213 | result.imageIndex = jsonObject["imageIndex"]
214 | result.faces = []
215 | if (jsonObject["faces"] != null)
216 | for (const i in jsonObject["faces"])
217 | result.faces.push(MatchFacesDetectionFace.fromJson(jsonObject["faces"][i]))
218 | result.exception = MatchFacesException.fromJson(jsonObject["exception"])
219 |
220 | return result
221 | }
222 | }
223 |
224 | export class Point {
225 | static fromJson(jsonObject) {
226 | if (jsonObject == null) return null
227 | const result = new Point()
228 |
229 | result.x = jsonObject["x"]
230 | result.y = jsonObject["y"]
231 |
232 | return result
233 | }
234 | }
235 |
236 | export class Rect {
237 | static fromJson(jsonObject) {
238 | if (jsonObject == null) return null
239 | const result = new Rect()
240 |
241 | result.bottom = jsonObject["bottom"]
242 | result.top = jsonObject["top"]
243 | result.left = jsonObject["left"]
244 | result.right = jsonObject["right"]
245 |
246 | return result
247 | }
248 | }
249 |
250 | export class MatchFacesSimilarityThresholdSplit {
251 | static fromJson(jsonObject) {
252 | if (jsonObject == null) return null
253 | const result = new MatchFacesSimilarityThresholdSplit()
254 |
255 | result.matchedFaces = []
256 | if (jsonObject["matchedFaces"] != null)
257 | for (const i in jsonObject["matchedFaces"])
258 | result.matchedFaces.push(MatchFacesComparedFacesPair.fromJson(jsonObject["matchedFaces"][i]))
259 | result.unmatchedFaces = []
260 | if (jsonObject["unmatchedFaces"] != null)
261 | for (const i in jsonObject["unmatchedFaces"])
262 | result.unmatchedFaces.push(MatchFacesComparedFacesPair.fromJson(jsonObject["unmatchedFaces"][i]))
263 |
264 | return result
265 | }
266 | }
267 |
268 | export class DetectFacesRequest {
269 | static fromJson(jsonObject) {
270 | if (jsonObject == null) return null
271 | const result = new DetectFacesRequest()
272 |
273 | result.scenario = jsonObject["scenario"]
274 | result.image = jsonObject["image"]
275 | result.configuration = DetectFacesConfiguration.fromJson(jsonObject["configuration"])
276 |
277 | return result
278 | }
279 | }
280 |
281 | export class DetectFacesConfiguration {
282 | static fromJson(jsonObject) {
283 | if (jsonObject == null) return null
284 | const result = new DetectFacesConfiguration()
285 |
286 | result.attributes = []
287 | if (jsonObject["attributes"] != null)
288 | for (const i in jsonObject["attributes"])
289 | result.attributes.push(jsonObject["attributes"][i])
290 | result.customQuality = []
291 | if (jsonObject["customQuality"] != null)
292 | for (const i in jsonObject["customQuality"])
293 | result.customQuality.push(ImageQualityCharacteristic.fromJson(jsonObject["customQuality"][i]))
294 | result.outputImageParams = OutputImageParams.fromJson(jsonObject["outputImageParams"])
295 | result.onlyCentralFace = jsonObject["onlyCentralFace"]
296 |
297 | return result
298 | }
299 | }
300 |
301 | export class OutputImageParams {
302 | static fromJson(jsonObject) {
303 | if (jsonObject == null) return null
304 | const result = new OutputImageParams()
305 |
306 | result.backgroundColor = jsonObject["backgroundColor"]
307 | result.crop = OutputImageCrop.fromJson(jsonObject["crop"])
308 |
309 | return result
310 | }
311 | }
312 |
313 | export class OutputImageCrop {
314 | static fromJson(jsonObject) {
315 | if (jsonObject == null) return null
316 | const result = new OutputImageCrop()
317 |
318 | result.type = jsonObject["type"]
319 | result.size = Size.fromJson(jsonObject["size"])
320 | result.padColor = jsonObject["padColor"]
321 | result.returnOriginalRect = jsonObject["returnOriginalRect"]
322 |
323 | return result
324 | }
325 | }
326 |
327 | export class ImageQualityCharacteristic {
328 | static fromJson(jsonObject) {
329 | if (jsonObject == null) return null
330 | const result = new ImageQualityCharacteristic()
331 |
332 | result.characteristicName = jsonObject["characteristicName"]
333 | result.imageQualityGroup = jsonObject["imageQualityGroup"]
334 | result.recommendedRange = ImageQualityRange.fromJson(jsonObject["recommendedRange"])
335 | result.customRange = ImageQualityRange.fromJson(jsonObject["customRange"])
336 |
337 | return result
338 | }
339 | }
340 |
341 | export class ImageQualityRange {
342 | static fromJson(jsonObject) {
343 | if (jsonObject == null) return null
344 | const result = new ImageQualityRange()
345 |
346 | result.min = jsonObject["min"]
347 | result.max = jsonObject["max"]
348 |
349 | return result
350 | }
351 | }
352 |
353 | export class Size {
354 | static fromJson(jsonObject) {
355 | if (jsonObject == null) return null
356 | const result = new Size()
357 |
358 | result.width = jsonObject["width"]
359 | result.height = jsonObject["height"]
360 |
361 | return result
362 | }
363 | }
364 |
365 | export class DetectFacesResponse {
366 | static fromJson(jsonObject) {
367 | if (jsonObject == null) return null
368 | const result = new DetectFacesResponse()
369 |
370 | result.detection = DetectFaceResult.fromJson(jsonObject["detection"])
371 | result.scenario = jsonObject["scenario"]
372 | result.error = DetectFacesErrorException.fromJson(jsonObject["error"])
373 | result.allDetections = []
374 | if (jsonObject["allDetections"] != null)
375 | for (const i in jsonObject["allDetections"])
376 | result.allDetections.push(DetectFaceResult.fromJson(jsonObject["allDetections"][i]))
377 |
378 | return result
379 | }
380 | }
381 |
382 | export class DetectFacesErrorException {
383 | static fromJson(jsonObject) {
384 | if (jsonObject == null) return null
385 | const result = new DetectFacesErrorException()
386 |
387 | result.errorCode = jsonObject["errorCode"]
388 | result.underlyingException = DetectFacesBackendException.fromJson(jsonObject["underlyingException"])
389 | result.message = jsonObject["message"]
390 |
391 | return result
392 | }
393 | }
394 |
395 | export class DetectFacesBackendException {
396 | static fromJson(jsonObject) {
397 | if (jsonObject == null) return null
398 | const result = new DetectFacesBackendException()
399 |
400 | result.errorCode = jsonObject["errorCode"]
401 | result.message = jsonObject["message"]
402 |
403 | return result
404 | }
405 | }
406 |
407 | export class DetectFaceResult {
408 | static fromJson(jsonObject) {
409 | if (jsonObject == null) return null
410 | const result = new DetectFaceResult()
411 |
412 | result.quality = []
413 | if (jsonObject["quality"] != null)
414 | for (const i in jsonObject["quality"])
415 | result.quality.push(ImageQualityResult.fromJson(jsonObject["quality"][i]))
416 | result.attributes = []
417 | if (jsonObject["attributes"] != null)
418 | for (const i in jsonObject["attributes"])
419 | result.attributes.push(DetectFacesAttributeResult.fromJson(jsonObject["attributes"][i]))
420 | result.landmarks = []
421 | if (jsonObject["landmarks"] != null)
422 | for (const i in jsonObject["landmarks"])
423 | result.landmarks.push(Point.fromJson(jsonObject["landmarks"][i]))
424 | result.crop = jsonObject["crop"]
425 | result.faceRect = Rect.fromJson(jsonObject["faceRect"])
426 | result.originalRect = Rect.fromJson(jsonObject["originalRect"])
427 | result.isQualityCompliant = jsonObject["isQualityCompliant"]
428 |
429 | return result
430 | }
431 | }
432 |
433 | export class ImageQualityResult {
434 | static fromJson(jsonObject) {
435 | if (jsonObject == null) return null
436 | const result = new ImageQualityResult()
437 |
438 | result.name = jsonObject["name"]
439 | result.group = jsonObject["group"]
440 | result.status = jsonObject["status"]
441 | result.range = ImageQualityRange.fromJson(jsonObject["range"])
442 | result.value = jsonObject["value"]
443 |
444 | return result
445 | }
446 | }
447 |
448 | export class DetectFacesAttributeResult {
449 | static fromJson(jsonObject) {
450 | if (jsonObject == null) return null
451 | const result = new DetectFacesAttributeResult()
452 |
453 | result.attribute = jsonObject["attribute"]
454 | result.value = jsonObject["value"]
455 | result.range = ImageQualityRange.fromJson(jsonObject["range"])
456 | result.confidence = jsonObject["confidence"]
457 |
458 | return result
459 | }
460 | }
461 |
462 | // Enum
463 |
464 | export const ImageQualityGroupName = {
465 | IMAGE_CHARACTERISTICS: 1,
466 | HEAD_SIZE_AND_POSITION: 2,
467 | FACE_QUALITY: 3,
468 | EYES_CHARACTERISTICS: 4,
469 | SHADOWS_AND_LIGHTNING: 5,
470 | POSE_AND_EXPRESSION: 6,
471 | HEAD_OCCLUSION: 7,
472 | BACKGROUND: 8,
473 | UNKNOWN: 9,
474 | }
475 |
476 | export const DetectFacesErrorCode = {
477 | IMAGE_EMPTY: "IMAGE_EMPTY",
478 | FR_FACE_NOT_DETECTED: "FR_FACE_NOT_DETECTED",
479 | FACER_NO_LICENSE: "FACER_NO_LICENSE",
480 | FACER_IS_NOT_INITIALIZED: "FACER_IS_NOT_INITIALIZED",
481 | FACER_COMMAND_IS_NOT_SUPPORTED: "FACER_COMMAND_IS_NOT_SUPPORTED",
482 | FACER_COMMAND_PARAMS_READ_ERROR: "FACER_COMMAND_PARAMS_READ_ERROR",
483 | PROCESSING_FAILED: "PROCESSING_FAILED",
484 | REQUEST_FAILED: "REQUEST_FAILED",
485 | API_CALL_FAILED: "API_CALL_FAILED",
486 | }
487 |
488 | export const InitErrorCode = {
489 | IN_PROGRESS_ALREADY: "IN_PROGRESS_ALREADY",
490 | CONTEXT_IS_NULL: "CONTEXT_IS_NULL",
491 | MISSING_CORE: "MISSING_CORE",
492 | INTERNAL_CORE_ERROR: "INTERNAL_CORE_ERROR",
493 | }
494 |
495 | export const LivenessStatus = {
496 | PASSED: "PASSED",
497 | UNKNOWN: "UNKNOWN",
498 | }
499 |
500 | export const CameraErrorCode = {
501 | CAMERA_NOT_AVAILABLE: "CAMERA_NOT_AVAILABLE",
502 | CAMERA_NO_PERMISSION: "CAMERA_NO_PERMISSION",
503 | }
504 |
505 | export const LivenessErrorCode = {
506 | CONTEXT_IS_NULL: "CONTEXT_IS_NULL",
507 | IN_PROGRESS_ALREADY: "IN_PROGRESS_ALREADY",
508 | ZOOM_NOT_SUPPORTED: "ZOOM_NOT_SUPPORTED",
509 | NO_LICENSE: "NO_LICENSE",
510 | CANCELLED: "CANCELLED",
511 | PROCESSING_TIMEOUT: "PROCESSING_TIMEOUT",
512 | API_CALL_FAILED: "API_CALL_FAILED",
513 | PROCESSING_FAILED: "PROCESSING_FAILED",
514 | NOT_INITIALIZED: "NOT_INITIALIZED",
515 | CAMERA_NO_PERMISSION: "CAMERA_NO_PERMISSION",
516 | CAMERA_NOT_AVAILABLE: "CAMERA_NOT_AVAILABLE",
517 | PROCESSING_FRAME_FAILED: "PROCESSING_FRAME_FAILED",
518 | }
519 |
520 | export const DetectFacesBackendErrorCode = {
521 | FR_FACE_NOT_DETECTED: 2,
522 | FACER_NO_LICENSE: 200,
523 | FACER_IS_NOT_INITIALIZED: 201,
524 | FACER_COMMAND_IS_NOT_SUPPORTED: 202,
525 | FACER_COMMAND_PARAMS_READ_ERROR: 203,
526 | UNDEFINED: -1,
527 | }
528 |
529 | export const MatchFacesErrorCode = {
530 | IMAGE_EMPTY: "IMAGE_EMPTY",
531 | FACE_NOT_DETECTED: "FACE_NOT_DETECTED",
532 | LANDMARKS_NOT_DETECTED: "LANDMARKS_NOT_DETECTED",
533 | FACE_ALIGNER_FAILED: "FACE_ALIGNER_FAILED",
534 | DESCRIPTOR_EXTRACTOR_ERROR: "DESCRIPTOR_EXTRACTOR_ERROR",
535 | NO_LICENSE: "NO_LICENSE",
536 | IMAGES_COUNT_LIMIT_EXCEEDED: "IMAGES_COUNT_LIMIT_EXCEEDED",
537 | API_CALL_FAILED: "API_CALL_FAILED",
538 | PROCESSING_FAILED: "PROCESSING_FAILED",
539 | }
540 |
541 | export const ImageQualityCharacteristicName = {
542 | IMAGE_WIDTH: "ImageWidth",
543 | IMAGE_HEIGHT: "ImageHeight",
544 | IMAGE_WIDTH_TO_HEIGHT: "ImageWidthToHeight",
545 | IMAGE_CHANNELS_NUMBER: "ImageChannelsNumber",
546 | PADDING_RATIO: "PaddingRatio",
547 | FACE_MID_POINT_HORIZONTAL_POSITION: "FaceMidPointHorizontalPosition",
548 | FACE_MID_POINT_VERTICAL_POSITION: "FaceMidPointVerticalPosition",
549 | HEAD_WIDTH_RATIO: "HeadWidthRatio",
550 | HEAD_HEIGHT_RATIO: "HeadHeightRatio",
551 | EYES_DISTANCE: "EyesDistance",
552 | YAW: "Yaw",
553 | PITCH: "Pitch",
554 | ROLL: "Roll",
555 | BLUR_LEVEL: "BlurLevel",
556 | NOISE_LEVEL: "NoiseLevel",
557 | UNNATURAL_SKIN_TONE: "UnnaturalSkinTone",
558 | FACE_DYNAMIC_RANGE: "FaceDynamicRange",
559 | EYE_RIGHT_CLOSED: "EyeRightClosed",
560 | EYE_LEFT_CLOSED: "EyeLeftClosed",
561 | EYE_RIGHT_OCCLUDED: "EyeRightOccluded",
562 | EYE_LEFT_OCCLUDED: "EyeLeftOccluded",
563 | EYES_RED: "EyesRed",
564 | EYE_RIGHT_COVERED_WITH_HAIR: "EyeRightCoveredWithHair",
565 | EYE_LEFT_COVERED_WITH_HAIR: "EyeLeftCoveredWithHair",
566 | OFF_GAZE: "OffGaze",
567 | TOO_DARK: "TooDark",
568 | TOO_LIGHT: "TooLight",
569 | FACE_GLARE: "FaceGlare",
570 | SHADOWS_ON_FACE: "ShadowsOnFace",
571 | SHOULDERS_POSE: "ShouldersPose",
572 | EXPRESSION_LEVEL: "ExpressionLevel",
573 | MOUTH_OPEN: "MouthOpen",
574 | SMILE: "Smile",
575 | DARK_GLASSES: "DarkGlasses",
576 | REFLECTION_ON_GLASSES: "ReflectionOnGlasses",
577 | FRAMES_TOO_HEAVY: "FramesTooHeavy",
578 | FACE_OCCLUDED: "FaceOccluded",
579 | HEAD_COVERING: "HeadCovering",
580 | FOREHEAD_COVERING: "ForeheadCovering",
581 | STRONG_MAKEUP: "StrongMakeup",
582 | HEAD_PHONES: "Headphones",
583 | MEDICAL_MASK: "MedicalMask",
584 | BACKGROUND_UNIFORMITY: "BackgroundUniformity",
585 | SHADOWS_ON_BACKGROUND: "ShadowsOnBackground",
586 | OTHER_FACES: "OtherFaces",
587 | BACKGROUND_COLOR_MATCH: "BackgroundColorMatch",
588 | UNKNOWN: "Unknown",
589 | }
590 |
591 | export const DetectFacesScenario = {
592 | CROP_CENTRAL_FACE: "CropCentralFace",
593 | CROP_ALL_FACES: "CropAllFaces",
594 | THUMBNAIL: "Thumbnail",
595 | ATTRIBUTES_ALL: "AttributesAll",
596 | QUALITY_FULL: "QualityFull",
597 | QUALITY_ICAO: "QualityICAO",
598 | QUALITY_VISA_SCHENGEN: "QualityVisaSchengen",
599 | QUALITY_VISA_USA: "QualityVisaUSA",
600 | }
601 |
602 | export const OutputImageCropAspectRatio = {
603 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_3X4: 0,
604 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_4X5: 1,
605 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_2X3: 2,
606 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_1X1: 3,
607 | OUTPUT_IMAGE_CROP_ASPECT_RATIO_7X9: 4,
608 | }
609 |
610 | export const LivenessSkipStep = {
611 | NONE: 0,
612 | START_STEP: 1,
613 | DONE_STEP: 2,
614 | }
615 |
616 | export const ImageQualityResultStatus = {
617 | IMAGE_QUALITY_RESULT_STATUS_FALSE: 0,
618 | IMAGE_QUALITY_RESULT_STATUS_TRUE: 1,
619 | IMAGE_QUALITY_RESULT_STATUS_UNDETERMINED: 2,
620 | }
621 |
622 | export const ImageType = {
623 | PRINTED: 1,
624 | RFID: 2,
625 | LIVE: 3,
626 | DOCUMENT_WITH_LIVE: 4,
627 | EXTERNAL: 5,
628 | GHOST_PORTRAIT: 6,
629 | }
630 |
631 | export const FaceCaptureErrorCode = {
632 | CANCEL: "CANCEL",
633 | CAMERA_NOT_AVAILABLE: "CAMERA_NOT_AVAILABLE",
634 | CAMERA_NO_PERMISSION: "CAMERA_NO_PERMISSION",
635 | IN_PROGRESS_ALREADY: "IN_PROGRESS_ALREADY",
636 | CONTEXT_IS_NULL: "CONTEXT_IS_NULL",
637 | TIMEOUT: "TIMEOUT",
638 | NOT_INITIALIZED: "NOT_INITIALIZED",
639 | }
640 |
641 | export const LivenessBackendErrorCode = {
642 | UNDEFINED: -1,
643 | NO_LICENSE: 200,
644 | LOW_QUALITY: 231,
645 | HIGH_ASYMMETRY: 232,
646 | TRACK_BREAK: 246,
647 | CLOSED_EYES_DETECTED: 230,
648 | FACE_OVER_EMOTIONAL: 233,
649 | SUNGLASSES_DETECTED: 234,
650 | SMALL_AGE: 235,
651 | HEADDRESS_DETECTED: 236,
652 | MEDICINE_MASK_DETECTED: 239,
653 | OCCLUSION_DETECTED: 240,
654 | FOREHEAD_GLASSES_DETECTED: 242,
655 | MOUTH_OPENED: 243,
656 | ART_MASK_DETECTED: 244,
657 | NOT_MATCHED: 237,
658 | IMAGES_COUNT_LIMIT_EXCEEDED: 238,
659 | ELECTRONIC_DEVICE_DETECTED: 245,
660 | WRONG_GEO: 247,
661 | WRONG_OF: 248,
662 | WRONG_VIEW: 249,
663 | }
664 |
665 | export const DetectFacesAttribute = {
666 | AGE: "Age",
667 | EYE_RIGHT: "EyeRight",
668 | EYE_LEFT: "EyeLeft",
669 | EMOTION: "Emotion",
670 | SMILE: "Smile",
671 | GLASSES: "Glasses",
672 | HEAD_COVERING: "HeadCovering",
673 | FOREHEAD_COVERING: "ForeheadCovering",
674 | MOUTH: "Mouth",
675 | MEDICAL_MASK: "MedicalMask",
676 | OCCLUSION: "Occlusion",
677 | STRONG_MAKEUP: "StrongMakeup",
678 | HEADPHONES: "Headphones",
679 | }
680 |
681 | export const Enum = {
682 | ImageQualityGroupName,
683 | DetectFacesErrorCode,
684 | InitErrorCode,
685 | LivenessStatus,
686 | CameraErrorCode,
687 | LivenessErrorCode,
688 | DetectFacesBackendErrorCode,
689 | MatchFacesErrorCode,
690 | ImageQualityCharacteristicName,
691 | DetectFacesScenario,
692 | OutputImageCropAspectRatio,
693 | LivenessSkipStep,
694 | ImageQualityResultStatus,
695 | ImageType,
696 | FaceCaptureErrorCode,
697 | LivenessBackendErrorCode,
698 | DetectFacesAttribute,
699 | }
700 |
701 | const FaceSDK = {}
702 |
703 | FaceSDK.getServiceUrl = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "getServiceUrl", [], successCallback, errorCallback)
704 | FaceSDK.startLiveness = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "startLiveness", [], successCallback, errorCallback)
705 | FaceSDK.getFaceSdkVersion = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "getFaceSdkVersion", [], successCallback, errorCallback)
706 | FaceSDK.presentFaceCaptureActivity = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "presentFaceCaptureActivity", [], successCallback, errorCallback)
707 | FaceSDK.stopFaceCaptureActivity = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "stopFaceCaptureActivity", [], successCallback, errorCallback)
708 | FaceSDK.init = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "init", [], successCallback, errorCallback)
709 | FaceSDK.deinit = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "deinit", [], successCallback, errorCallback)
710 | FaceSDK.isInitialized = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "isInitialized", [], successCallback, errorCallback)
711 | FaceSDK.stopLivenessProcessing = (successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "stopLivenessProcessing", [], successCallback, errorCallback)
712 | FaceSDK.setRequestHeaders = (headers, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "setRequestHeaders", [headers], successCallback, errorCallback)
713 | FaceSDK.presentFaceCaptureActivityWithConfig = (config, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "presentFaceCaptureActivityWithConfig", [config], successCallback, errorCallback)
714 | FaceSDK.startLivenessWithConfig = (config, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "startLivenessWithConfig", [config], successCallback, errorCallback)
715 | FaceSDK.setServiceUrl = (url, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "setServiceUrl", [url], successCallback, errorCallback)
716 | FaceSDK.matchFaces = (request, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "matchFaces", [request], successCallback, errorCallback)
717 | FaceSDK.detectFaces = (request, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "detectFaces", [request], successCallback, errorCallback)
718 | FaceSDK.matchFacesWithConfig = (request, config, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "matchFacesWithConfig", [request, config], successCallback, errorCallback)
719 | FaceSDK.setLanguage = (language, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "setLanguage", [language], successCallback, errorCallback)
720 | FaceSDK.matchFacesSimilarityThresholdSplit = (faces, similarity, successCallback, errorCallback) => RNFaceApi.exec("FaceApi", "matchFacesSimilarityThresholdSplit", [faces, similarity], successCallback, errorCallback)
721 |
722 | export default FaceSDK
--------------------------------------------------------------------------------
/ios/RFSWJSONConstructor.h:
--------------------------------------------------------------------------------
1 | #ifndef RFSWJSONConstructor_h
2 | #define RFSWJSONConstructor_h
3 |
4 | @import UIKit;
5 | @import FaceSDK;
6 |
7 | @interface RFSWJSONConstructor : NSObject
8 |
9 | +(NSString* _Nonnull)dictToString:(NSMutableDictionary* _Nonnull)input;
10 | +(NSMutableDictionary* _Nonnull)generateInitCompletion:(BOOL)success :(NSError* _Nullable)error;
11 | +(NSMutableDictionary* _Nonnull)generateVideoEncoderCompletion:(NSString * _Nonnull)transactionId :(BOOL)success;
12 | +(RFSMatchFacesRequest* _Nonnull)RFSMatchFacesRequestFromJSON:(NSDictionary* _Nonnull)input;
13 | +(NSMutableArray*_Nonnull)NSArrayRFSMatchFacesComparedFacesPairFromJSON:(NSArray* _Nonnull)input;
14 | +(RFSDetectFacesRequest* _Nonnull)RFSDetectFacesRequestFromJSON:(NSDictionary* _Nonnull)input;
15 | +(NSMutableDictionary* _Nonnull)generateRFSFaceCaptureResponse:(RFSFaceCaptureResponse* _Nullable)input;
16 | +(NSMutableDictionary* _Nonnull)generateRFSLivenessResponse:(RFSLivenessResponse* _Nullable)input;
17 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesResponse:(RFSMatchFacesResponse* _Nullable)input;
18 | +(NSMutableDictionary* _Nonnull)generateRFSImage:(RFSImage* _Nullable)input;
19 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesImage:(RFSMatchFacesImage* _Nullable)input;
20 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesComparedFacesPair:(RFSMatchFacesComparedFacesPair* _Nullable)input;
21 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesComparedFace:(RFSMatchFacesComparedFace* _Nullable)input;
22 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesDetectionFace:(RFSMatchFacesDetectionFace* _Nullable)input;
23 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesDetection:(RFSMatchFacesDetection* _Nullable)input;
24 | +(NSMutableDictionary* _Nonnull)generateRFSPoint:(RFSPoint* _Nullable)input;
25 | +(NSMutableDictionary* _Nonnull)generateRFSMatchFacesSimilarityThresholdSplit:(RFSMatchFacesSimilarityThresholdSplit* _Nullable)input;
26 | +(NSMutableDictionary* _Nonnull)generateRFSImageQualityRange:(RFSImageQualityRange* _Nullable)input;
27 | +(NSMutableDictionary* _Nonnull)generateRFSDetectFacesResponse:(RFSDetectFacesResponse* _Nullable)input;
28 | +(NSMutableDictionary* _Nonnull)generateRFSDetectFaceResult:(RFSDetectFaceResult* _Nullable)input;
29 | +(NSMutableDictionary* _Nonnull)generateRFSImageQualityResult:(RFSImageQualityResult* _Nullable)input;
30 | +(NSMutableDictionary* _Nonnull)generateRFSDetectFacesAttributeResult:(RFSDetectFacesAttributeResult* _Nullable)input;
31 |
32 | @end
33 | #endif
--------------------------------------------------------------------------------
/ios/RNFaceApi.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "RFSWJSONConstructor.h"
4 | @import UIKit;
5 | @import FaceSDK;
6 |
7 | @interface RNFaceApi : RCTEventEmitter
8 | @property NSDictionary* headers;
9 | @end
10 |
--------------------------------------------------------------------------------
/ios/RNFaceApi.m:
--------------------------------------------------------------------------------
1 | #import "RNFaceApi.h"
2 |
3 | @implementation RNFaceApi
4 |
5 | RCT_EXPORT_MODULE();
6 |
7 | NSString* videoEncoderCompletionEvent = @"videoEncoderCompletionEvent";
8 |
9 | RNFaceApi* faceApiPlugin;
10 |
11 | - (NSArray*)supportedEvents {
12 | return @[videoEncoderCompletionEvent];
13 | }
14 |
15 | typedef void (^Callback)(NSString* response);
16 |
17 | - (void)result:(NSString*)message :(Callback)callback {
18 | callback(message);
19 | }
20 |
21 | typedef void (^VideoEncoderCompletion)(NSString * _Nonnull transactionId, BOOL success);
22 | VideoEncoderCompletion sendVideoEncoderCompletion = ^(NSString * _Nonnull transactionId, BOOL success) {
23 | [faceApiPlugin sendEventWithName:videoEncoderCompletionEvent body:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateVideoEncoderCompletion:transactionId :success]]];
24 | };
25 |
26 | RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(RCTResponseSenderBlock)sCallback:(RCTResponseSenderBlock)eCallback) {
27 | faceApiPlugin = self;
28 | Callback successCallback = ^(NSString* response){
29 | sCallback(@[response]);
30 | };
31 | Callback errorCallback = ^(NSString* response){
32 | eCallback(@[response]);
33 | };
34 |
35 | if([action isEqualToString:@"getServiceUrl"])
36 | [self getServiceUrl :successCallback :errorCallback];
37 | else if([action isEqualToString:@"startLiveness"])
38 | [self startLiveness :successCallback :errorCallback];
39 | else if([action isEqualToString:@"getFaceSdkVersion"])
40 | [self getFaceSdkVersion :successCallback :errorCallback];
41 | else if([action isEqualToString:@"presentFaceCaptureActivity"])
42 | [self presentFaceCaptureActivity :successCallback :errorCallback];
43 | else if([action isEqualToString:@"stopFaceCaptureActivity"])
44 | [self stopFaceCaptureActivity :successCallback :errorCallback];
45 | else if([action isEqualToString:@"init"])
46 | [self init :successCallback :errorCallback];
47 | else if([action isEqualToString:@"deinit"])
48 | [self deinit :successCallback :errorCallback];
49 | else if([action isEqualToString:@"isInitialized"])
50 | [self isInitialized :successCallback :errorCallback];
51 | else if([action isEqualToString:@"stopLivenessProcessing"])
52 | [self stopLivenessProcessing :successCallback :errorCallback];
53 | else if([action isEqualToString:@"setRequestHeaders"])
54 | [self setRequestHeaders :[args objectAtIndex:0] :successCallback :errorCallback];
55 | else if([action isEqualToString:@"presentFaceCaptureActivityWithConfig"])
56 | [self presentFaceCaptureActivityWithConfig :[args objectAtIndex:0] :successCallback :errorCallback];
57 | else if([action isEqualToString:@"startLivenessWithConfig"])
58 | [self startLivenessWithConfig :[args objectAtIndex:0] :successCallback :errorCallback];
59 | else if([action isEqualToString:@"setServiceUrl"])
60 | [self setServiceUrl :[args objectAtIndex:0] :successCallback :errorCallback];
61 | else if([action isEqualToString:@"matchFaces"])
62 | [self matchFaces :[args objectAtIndex:0] :successCallback :errorCallback];
63 | else if([action isEqualToString:@"detectFaces"])
64 | [self detectFaces :[args objectAtIndex:0] :successCallback :errorCallback];
65 | else if([action isEqualToString:@"matchFacesWithConfig"])
66 | [self matchFacesWithConfig :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
67 | else if([action isEqualToString:@"setLanguage"])
68 | [self setLanguage :[args objectAtIndex:0] :successCallback :errorCallback];
69 | else if([action isEqualToString:@"matchFacesSimilarityThresholdSplit"])
70 | [self matchFacesSimilarityThresholdSplit :[args objectAtIndex:0] :[args objectAtIndex:1] :successCallback :errorCallback];
71 | else
72 | [self result:[NSString stringWithFormat:@"%@/%@", @"method not implemented: ", action] :errorCallback];
73 | }
74 |
75 | - (void) getServiceUrl:(Callback)successCallback :(Callback)errorCallback{
76 | [self result:[RFSFaceSDK.service serviceURL] :successCallback];
77 | }
78 |
79 | NSDictionary* headers;
80 | - (void) setRequestHeaders:(NSDictionary*)headers :(Callback)successCallback :(Callback)errorCallback {
81 | self.headers = headers;
82 | RFSFaceSDK.service.requestInterceptingDelegate = self;
83 | [self result:@"" :successCallback];
84 | }
85 |
86 | - (void) startLiveness:(Callback)successCallback :(Callback)errorCallback{
87 | dispatch_async(dispatch_get_main_queue(), ^{
88 | [RFSFaceSDK.service startLivenessFrom:[[[UIApplication sharedApplication] keyWindow] rootViewController] animated:true onLiveness:[self getLivenessCompletion:successCallback :errorCallback] completion:nil];
89 | });
90 | }
91 |
92 | - (void) getFaceSdkVersion:(Callback)successCallback :(Callback)errorCallback{
93 | [self result:[RFSFaceSDK.service version] :successCallback];
94 | }
95 |
96 | - (void) init:(Callback)successCallback :(Callback)errorCallback{
97 | [RFSFaceSDK.service initializeWithCompletion:^(BOOL success, NSError * _Nullable error) {
98 | if(success)
99 | [RFSFaceSDK.service setVideoUploadingDelegate:self];
100 | [self result:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateInitCompletion:success :error]] :successCallback];
101 | }];
102 | }
103 |
104 | - (void) deinit:(Callback)successCallback :(Callback)errorCallback{
105 | [RFSFaceSDK.service deinitialize];
106 | [self result:@"" :successCallback];
107 | }
108 |
109 | - (void) isInitialized:(Callback)successCallback :(Callback)errorCallback {
110 | [self result:@"isInitialized() is an android-only method" :errorCallback];
111 | }
112 |
113 | - (void) presentFaceCaptureActivity:(Callback)successCallback :(Callback)errorCallback{
114 | dispatch_async(dispatch_get_main_queue(), ^{
115 | [RFSFaceSDK.service presentFaceCaptureViewControllerFrom:[[[UIApplication sharedApplication] keyWindow] rootViewController] animated:true onCapture:[self getFaceCaptureCompletion:successCallback :errorCallback] completion:nil];
116 | });
117 | }
118 |
119 | - (void) stopFaceCaptureActivity:(Callback)successCallback :(Callback)errorCallback{
120 | [RFSFaceSDK.service stopFaceCaptureViewController];
121 | [self result:@"" :successCallback];
122 | }
123 |
124 | - (void) stopLivenessProcessing:(Callback)successCallback :(Callback)errorCallback{
125 | [RFSFaceSDK.service stopLivenessProcessing];
126 | [self result:@"" :successCallback];
127 | }
128 |
129 | - (void) presentFaceCaptureActivityWithConfig:(NSDictionary*)config :(Callback)successCallback :(Callback)errorCallback{
130 | RFSFaceCaptureConfiguration *configuration = [RFSFaceCaptureConfiguration configurationWithBuilder:^(RFSFaceCaptureConfigurationBuilder * _Nonnull builder) {
131 | if([config valueForKey:@"copyright"] != nil)
132 | [builder setCopyright:[[config valueForKey:@"copyright"] boolValue]];
133 | if([config valueForKey:@"cameraSwitchEnabled"] != nil)
134 | [builder setCameraSwitchButtonEnabled:[[config valueForKey:@"cameraSwitchEnabled"] boolValue]];
135 | if([config valueForKey:@"cameraPositionIOS"] != nil)
136 | [builder setCameraPosition:[self RFSCameraPositionWithNSInteger:[[config valueForKey:@"cameraPositionIOS"] integerValue]]];
137 | if([config valueForKey:@"timeout"] != nil)
138 | [builder setTimeoutInterval:[config valueForKey:@"timeout"]];
139 | if([config valueForKey:@"torchButtonEnabled"] != nil)
140 | [builder setTorchButtonEnabled:[self RFSCameraPositionWithNSInteger:[[config valueForKey:@"torchButtonEnabled"] integerValue]]];
141 | if([config valueForKey:@"closeButtonEnabled"] != nil)
142 | [builder setCloseButtonEnabled:[self RFSCameraPositionWithNSInteger:[[config valueForKey:@"closeButtonEnabled"] integerValue]]];
143 | }];
144 | dispatch_async(dispatch_get_main_queue(), ^{
145 | [RFSFaceSDK.service presentFaceCaptureViewControllerFrom:[[[UIApplication sharedApplication] keyWindow] rootViewController] animated:true configuration: configuration onCapture:[self getFaceCaptureCompletion:successCallback :errorCallback] completion:nil];
146 | });
147 | }
148 |
149 | - (void) startLivenessWithConfig:(NSDictionary*)config :(Callback)successCallback :(Callback)errorCallback{
150 | RFSLivenessConfiguration *configuration = [RFSLivenessConfiguration configurationWithBuilder:^(RFSLivenessConfigurationBuilder * _Nonnull builder) {
151 | if([config valueForKey:@"copyright"] != nil)
152 | [builder setCopyright:[[config valueForKey:@"copyright"] boolValue]];
153 | if([config valueForKey:@"attemptsCount"] != nil)
154 | [builder setAttemptsCount:[[config valueForKey:@"attemptsCount"] integerValue]];
155 | if([config valueForKey:@"locationTrackingEnabled"] != nil)
156 | [builder setLocationTrackingEnabled:[[config valueForKey:@"locationTrackingEnabled"] boolValue]];
157 | if([config valueForKey:@"recordingProcess"] != nil)
158 | [builder setRecordingProcessEnabled:[[config valueForKey:@"recordingProcess"] boolValue]];
159 | if([config valueForKey:@"closeButtonEnabled"] != nil)
160 | [builder setCloseButtonEnabled:[self RFSCameraPositionWithNSInteger:[[config valueForKey:@"closeButtonEnabled"] integerValue]]];
161 | if([config valueForKey:@"sessionId"] != nil)
162 | [builder setSessionId:[config valueForKey:@"sessionId"]];
163 | if([config valueForKey:@"skipStep"] != nil) {
164 | [builder setStepSkippingMask:[self RFSLivenessStepSkipWithNSInteger:[[config valueForKey:@"skipStep"] integerValue]]];
165 | }
166 | }];
167 | dispatch_async(dispatch_get_main_queue(), ^{
168 | [RFSFaceSDK.service startLivenessFrom:[[[UIApplication sharedApplication] keyWindow] rootViewController] animated:true configuration: configuration onLiveness:[self getLivenessCompletion:successCallback :errorCallback] completion:nil];
169 | });
170 | }
171 |
172 | - (void) setServiceUrl:(NSString*)url :(Callback)successCallback :(Callback)errorCallback{
173 | [RFSFaceSDK.service setServiceURL:url];
174 | [self result:@"" :successCallback];
175 | }
176 |
177 | - (void) matchFaces:(NSString*)requestString :(Callback)successCallback :(Callback)errorCallback{
178 | [RFSFaceSDK.service matchFaces:[RFSWJSONConstructor RFSMatchFacesRequestFromJSON:[NSJSONSerialization JSONObjectWithData:[requestString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:NULL]] completion:[self getMatchFacesCompletion:successCallback :errorCallback]];
179 | }
180 |
181 | - (void) detectFaces:(NSString*)requestString :(Callback)successCallback :(Callback)errorCallback{
182 | [RFSFaceSDK.service detectFacesByRequest:[RFSWJSONConstructor RFSDetectFacesRequestFromJSON:[NSJSONSerialization JSONObjectWithData:[requestString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:NULL]] completion:[self getDetectFacesCompletion:successCallback :errorCallback]];
183 | }
184 |
185 | - (void) matchFacesWithConfig:(NSString*)requestString :(NSDictionary*)config :(Callback)successCallback :(Callback)errorCallback{
186 | [RFSFaceSDK.service matchFaces:[RFSWJSONConstructor RFSMatchFacesRequestFromJSON:[NSJSONSerialization JSONObjectWithData:[requestString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:NULL]] completion:[self getMatchFacesCompletion:successCallback :errorCallback]];
187 | }
188 |
189 | - (void) matchFacesSimilarityThresholdSplit:(NSString*)str :(NSNumber*)similarity :(Callback)successCallback :(Callback)errorCallback{
190 | NSArray *array = [NSJSONSerialization JSONObjectWithData:[str dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil];
191 | NSArray *faces = [RFSWJSONConstructor NSArrayRFSMatchFacesComparedFacesPairFromJSON:array];
192 | RFSMatchFacesSimilarityThresholdSplit *split = [RFSMatchFacesSimilarityThresholdSplit splitPairs:faces bySimilarityThreshold:similarity];
193 | [self result:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateRFSMatchFacesSimilarityThresholdSplit:split]] :successCallback];
194 | }
195 |
196 | - (void) setLanguage:(NSString*)language :(Callback)successCallback :(Callback)errorCallback{
197 | RFSFaceSDK.service.localizationHandler = ^NSString * _Nullable(NSString * _Nonnull localizationKey) {
198 | NSString *result = NSLocalizedStringFromTable(localizationKey, language, @"");
199 | if (![result isEqualToString:localizationKey])
200 | return result;
201 | return nil;
202 | };
203 | [self result:@"" :successCallback];
204 | }
205 |
206 | - (void (^)(RFSLivenessResponse * _Nonnull)) getLivenessCompletion:(Callback)successCallback :(Callback)errorCallback {
207 | return ^(RFSLivenessResponse* response) {
208 | [self result:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateRFSLivenessResponse:response]] :successCallback];
209 | };
210 | }
211 |
212 | - (void (^)(RFSFaceCaptureResponse * _Nonnull)) getFaceCaptureCompletion:(Callback)successCallback :(Callback)errorCallback {
213 | return ^(RFSFaceCaptureResponse* response) {
214 | [self result:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateRFSFaceCaptureResponse:response]] :successCallback];
215 | };
216 | }
217 |
218 | - (void (^)(RFSMatchFacesResponse * _Nonnull)) getMatchFacesCompletion:(Callback)successCallback :(Callback)errorCallback {
219 | return ^(RFSMatchFacesResponse* response) {
220 | [self result:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateRFSMatchFacesResponse:response]] :successCallback];
221 | };
222 | }
223 |
224 | - (void (^)(RFSDetectFacesResponse* _Nonnull)) getDetectFacesCompletion:(Callback)successCallback :(Callback)errorCallback {
225 | return ^(RFSDetectFacesResponse* response) {
226 | [self result:[RFSWJSONConstructor dictToString:[RFSWJSONConstructor generateRFSDetectFacesResponse:response]] :successCallback];
227 | };
228 | }
229 |
230 | -(RFSCameraPosition)RFSCameraPositionWithNSInteger:(NSInteger)value {
231 | switch(value){
232 | case 0:
233 | return RFSCameraPositionBack;
234 | case 1:
235 | return RFSCameraPositionFront;
236 | default:
237 | return RFSCameraPositionBack;
238 | }
239 | }
240 |
241 | -(RFSLivenessStepSkip)RFSLivenessStepSkipWithNSInteger:(NSInteger)value {
242 | switch(value){
243 | case 0:
244 | return RFSLivenessStepSkipNone;
245 | case 1:
246 | return RFSLivenessStepSkipOnboarding;
247 | case 2:
248 | return RFSLivenessStepSkipSuccess;
249 | default:
250 | return RFSLivenessStepSkipNone;
251 | }
252 | }
253 |
254 | -(unsigned int)intFromHexString:(NSString *)hexStr {
255 | unsigned int hexInt = 0;
256 | NSScanner *scanner = [NSScanner scannerWithString:hexStr];
257 | [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"#"]];
258 | [scanner scanHexInt:&hexInt];
259 |
260 | return hexInt;
261 | }
262 |
263 | -(UIColor *)getUIColorObjectFromHexString:(NSString *)hexStr alpha:(CGFloat)alpha {
264 | unsigned int hexInt = [self intFromHexString:hexStr];
265 |
266 | UIColor *color =
267 | [UIColor colorWithRed:((CGFloat) ((hexInt & 0xFF0000) >> 16))/255
268 | green:((CGFloat) ((hexInt & 0xFF00) >> 8))/255
269 | blue:((CGFloat) (hexInt & 0xFF))/255
270 | alpha:alpha];
271 |
272 | return color;
273 | }
274 |
275 | - (NSURLRequest*)interceptorPrepareRequest:(NSURLRequest*)request {
276 | NSMutableURLRequest *interceptedRequest = [request mutableCopy];
277 | for(NSString* key in self.headers.allKeys)
278 | [interceptedRequest addValue:key forHTTPHeaderField:[self.headers valueForKey:key]];
279 | return interceptedRequest;
280 | }
281 |
282 | // Delegates
283 |
284 | // RFSVideoUploadingDelegate
285 | - (void)videoUploadingForTransactionId:(NSString * _Nonnull)transactionId didFinishedWithSuccess:(BOOL)success {
286 | sendVideoEncoderCompletion(transactionId, success);
287 | }
288 |
289 | @end
290 |
--------------------------------------------------------------------------------
/ios/RNFaceApi.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | B3E7B58A1CC2AC0600A0062D /* RNFaceApi.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNFaceApi.m */; };
11 | /* End PBXBuildFile section */
12 |
13 | /* Begin PBXCopyFilesBuildPhase section */
14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = {
15 | isa = PBXCopyFilesBuildPhase;
16 | buildActionMask = 2147483647;
17 | dstPath = "include/$(PRODUCT_NAME)";
18 | dstSubfolderSpec = 16;
19 | files = (
20 | );
21 | runOnlyForDeploymentPostprocessing = 0;
22 | };
23 | /* End PBXCopyFilesBuildPhase section */
24 |
25 | /* Begin PBXFileReference section */
26 | 134814201AA4EA6300B7C361 /* libRNFaceApi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFaceApi.a; sourceTree = BUILT_PRODUCTS_DIR; };
27 | B3E7B5881CC2AC0600A0062D /* RNFaceApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNFaceApi.h; sourceTree = ""; };
28 | B3E7B5891CC2AC0600A0062D /* RNFaceApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFaceApi.m; sourceTree = ""; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | );
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXFrameworksBuildPhase section */
40 |
41 | /* Begin PBXGroup section */
42 | 134814211AA4EA7D00B7C361 /* Products */ = {
43 | isa = PBXGroup;
44 | children = (
45 | 134814201AA4EA6300B7C361 /* libRNFaceApi.a */,
46 | );
47 | name = Products;
48 | sourceTree = "";
49 | };
50 | 58B511D21A9E6C8500147676 = {
51 | isa = PBXGroup;
52 | children = (
53 | B3E7B5881CC2AC0600A0062D /* RNFaceApi.h */,
54 | B3E7B5891CC2AC0600A0062D /* RNFaceApi.m */,
55 | 134814211AA4EA7D00B7C361 /* Products */,
56 | );
57 | sourceTree = "";
58 | };
59 | /* End PBXGroup section */
60 |
61 | /* Begin PBXNativeTarget section */
62 | 58B511DA1A9E6C8500147676 /* RNFaceApi */ = {
63 | isa = PBXNativeTarget;
64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNFaceApi" */;
65 | buildPhases = (
66 | 58B511D71A9E6C8500147676 /* Sources */,
67 | 58B511D81A9E6C8500147676 /* Frameworks */,
68 | 58B511D91A9E6C8500147676 /* CopyFiles */,
69 | );
70 | buildRules = (
71 | );
72 | dependencies = (
73 | );
74 | name = RNFaceApi;
75 | productName = RCTDataManager;
76 | productReference = 134814201AA4EA6300B7C361 /* libRNFaceApi.a */;
77 | productType = "com.apple.product-type.library.static";
78 | };
79 | /* End PBXNativeTarget section */
80 |
81 | /* Begin PBXProject section */
82 | 58B511D31A9E6C8500147676 /* Project object */ = {
83 | isa = PBXProject;
84 | attributes = {
85 | LastUpgradeCheck = 0830;
86 | ORGANIZATIONNAME = Facebook;
87 | TargetAttributes = {
88 | 58B511DA1A9E6C8500147676 = {
89 | CreatedOnToolsVersion = 6.1.1;
90 | };
91 | };
92 | };
93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNFaceApi" */;
94 | compatibilityVersion = "Xcode 3.2";
95 | developmentRegion = English;
96 | hasScannedForEncodings = 0;
97 | knownRegions = (
98 | en,
99 | );
100 | mainGroup = 58B511D21A9E6C8500147676;
101 | productRefGroup = 58B511D21A9E6C8500147676;
102 | projectDirPath = "";
103 | projectRoot = "";
104 | targets = (
105 | 58B511DA1A9E6C8500147676 /* RNFaceApi */,
106 | );
107 | };
108 | /* End PBXProject section */
109 |
110 | /* Begin PBXSourcesBuildPhase section */
111 | 58B511D71A9E6C8500147676 /* Sources */ = {
112 | isa = PBXSourcesBuildPhase;
113 | buildActionMask = 2147483647;
114 | files = (
115 | B3E7B58A1CC2AC0600A0062D /* RNFaceApi.m in Sources */,
116 | );
117 | runOnlyForDeploymentPostprocessing = 0;
118 | };
119 | /* End PBXSourcesBuildPhase section */
120 |
121 | /* Begin XCBuildConfiguration section */
122 | 58B511ED1A9E6C8500147676 /* Debug */ = {
123 | isa = XCBuildConfiguration;
124 | buildSettings = {
125 | ALWAYS_SEARCH_USER_PATHS = NO;
126 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
127 | CLANG_CXX_LIBRARY = "libc++";
128 | CLANG_ENABLE_MODULES = YES;
129 | CLANG_ENABLE_OBJC_ARC = YES;
130 | CLANG_WARN_BOOL_CONVERSION = YES;
131 | CLANG_WARN_CONSTANT_CONVERSION = YES;
132 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
133 | CLANG_WARN_EMPTY_BODY = YES;
134 | CLANG_WARN_ENUM_CONVERSION = YES;
135 | CLANG_WARN_INFINITE_RECURSION = YES;
136 | CLANG_WARN_INT_CONVERSION = YES;
137 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
138 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
139 | CLANG_WARN_UNREACHABLE_CODE = YES;
140 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
141 | COPY_PHASE_STRIP = NO;
142 | ENABLE_STRICT_OBJC_MSGSEND = YES;
143 | ENABLE_TESTABILITY = YES;
144 | GCC_C_LANGUAGE_STANDARD = gnu99;
145 | GCC_DYNAMIC_NO_PIC = NO;
146 | GCC_NO_COMMON_BLOCKS = YES;
147 | GCC_OPTIMIZATION_LEVEL = 0;
148 | GCC_PREPROCESSOR_DEFINITIONS = (
149 | "DEBUG=1",
150 | "$(inherited)",
151 | );
152 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
153 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
154 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
155 | GCC_WARN_UNDECLARED_SELECTOR = YES;
156 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
157 | GCC_WARN_UNUSED_FUNCTION = YES;
158 | GCC_WARN_UNUSED_VARIABLE = YES;
159 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
160 | MTL_ENABLE_DEBUG_INFO = YES;
161 | ONLY_ACTIVE_ARCH = YES;
162 | SDKROOT = iphoneos;
163 | };
164 | name = Debug;
165 | };
166 | 58B511EE1A9E6C8500147676 /* Release */ = {
167 | isa = XCBuildConfiguration;
168 | buildSettings = {
169 | ALWAYS_SEARCH_USER_PATHS = NO;
170 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
171 | CLANG_CXX_LIBRARY = "libc++";
172 | CLANG_ENABLE_MODULES = YES;
173 | CLANG_ENABLE_OBJC_ARC = YES;
174 | CLANG_WARN_BOOL_CONVERSION = YES;
175 | CLANG_WARN_CONSTANT_CONVERSION = YES;
176 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
177 | CLANG_WARN_EMPTY_BODY = YES;
178 | CLANG_WARN_ENUM_CONVERSION = YES;
179 | CLANG_WARN_INFINITE_RECURSION = YES;
180 | CLANG_WARN_INT_CONVERSION = YES;
181 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
182 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
183 | CLANG_WARN_UNREACHABLE_CODE = YES;
184 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
185 | COPY_PHASE_STRIP = YES;
186 | ENABLE_NS_ASSERTIONS = NO;
187 | ENABLE_STRICT_OBJC_MSGSEND = YES;
188 | GCC_C_LANGUAGE_STANDARD = gnu99;
189 | GCC_NO_COMMON_BLOCKS = YES;
190 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
191 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
192 | GCC_WARN_UNDECLARED_SELECTOR = YES;
193 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
194 | GCC_WARN_UNUSED_FUNCTION = YES;
195 | GCC_WARN_UNUSED_VARIABLE = YES;
196 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
197 | MTL_ENABLE_DEBUG_INFO = NO;
198 | SDKROOT = iphoneos;
199 | VALIDATE_PRODUCT = YES;
200 | };
201 | name = Release;
202 | };
203 | 58B511F01A9E6C8500147676 /* Debug */ = {
204 | isa = XCBuildConfiguration;
205 | buildSettings = {
206 | HEADER_SEARCH_PATHS = (
207 | "$(inherited)",
208 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
209 | "$(SRCROOT)/../../../React/**",
210 | "$(SRCROOT)/../../react-native/React/**",
211 | );
212 | LIBRARY_SEARCH_PATHS = "$(inherited)";
213 | OTHER_LDFLAGS = "-ObjC";
214 | PRODUCT_NAME = RNFaceApi;
215 | SKIP_INSTALL = YES;
216 | };
217 | name = Debug;
218 | };
219 | 58B511F11A9E6C8500147676 /* Release */ = {
220 | isa = XCBuildConfiguration;
221 | buildSettings = {
222 | HEADER_SEARCH_PATHS = (
223 | "$(inherited)",
224 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
225 | "$(SRCROOT)/../../../React/**",
226 | "$(SRCROOT)/../../react-native/React/**",
227 | );
228 | LIBRARY_SEARCH_PATHS = "$(inherited)";
229 | OTHER_LDFLAGS = "-ObjC";
230 | PRODUCT_NAME = RNFaceApi;
231 | SKIP_INSTALL = YES;
232 | };
233 | name = Release;
234 | };
235 | /* End XCBuildConfiguration section */
236 |
237 | /* Begin XCConfigurationList section */
238 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNFaceApi" */ = {
239 | isa = XCConfigurationList;
240 | buildConfigurations = (
241 | 58B511ED1A9E6C8500147676 /* Debug */,
242 | 58B511EE1A9E6C8500147676 /* Release */,
243 | );
244 | defaultConfigurationIsVisible = 0;
245 | defaultConfigurationName = Release;
246 | };
247 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNFaceApi" */ = {
248 | isa = XCConfigurationList;
249 | buildConfigurations = (
250 | 58B511F01A9E6C8500147676 /* Debug */,
251 | 58B511F11A9E6C8500147676 /* Release */,
252 | );
253 | defaultConfigurationIsVisible = 0;
254 | defaultConfigurationName = Release;
255 | };
256 | /* End XCConfigurationList section */
257 | };
258 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
259 | }
260 |
--------------------------------------------------------------------------------
/ios/RNFaceApi.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 |
3 |
5 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@regulaforensics/react-native-face-api",
3 | "version": "5.1.6",
4 | "description": "React Native module for compairing faces using phone`s camera",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [
10 | "react-native",
11 | "face",
12 | "scanner",
13 | "regula"
14 | ],
15 | "author": "Regulaforensics",
16 | "license": "commercial",
17 | "repository": {
18 | "type": "git",
19 | "url": "https://github.com/regulaforensics/react-native-face-api.git"
20 | },
21 | "homepage": "https://mobile.regulaforensics.com",
22 | "publishConfig": {
23 | "access": "public"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------