@regulaforensics/face-sdk 6.5.84-beta → 6.5.97-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RNFaceSDK.podspec +2 -2
- package/android/CVDFaceSDK.kt +11 -6
- package/android/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +7 -1
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +2 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +2 -7
- package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiModule.kt +9 -5
- package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +1 -1
- package/examples/capacitor/android/app/capacitor.build.gradle +5 -4
- package/examples/capacitor/android/capacitor.settings.gradle +3 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/examples/capacitor/android/variables.gradle +12 -12
- package/examples/capacitor/ios/App/Podfile +1 -0
- package/examples/capacitor/package.json +17 -19
- package/examples/capacitor/scripts/setup.sh +2 -0
- package/examples/capacitor/src/pages/Home.tsx +16 -12
- package/examples/cordova/package.json +2 -2
- package/examples/cordova/scripts/setup.sh +4 -1
- package/examples/ionic/package.json +2 -2
- package/examples/ionic/scripts/setup.sh +4 -1
- package/examples/ionic/src/app/home/home.page.ts +11 -11
- package/examples/react-native/package.json +2 -2
- package/package.json +1 -1
- package/plugin.xml +2 -2
package/RNFaceSDK.podspec
CHANGED
|
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
|
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
7
|
s.name = 'RNFaceSDK'
|
|
8
|
-
s.version = '6.5.
|
|
8
|
+
s.version = '6.5.97-beta'
|
|
9
9
|
s.summary = package['description']
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
|
|
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.ios.deployment_target = '12.0'
|
|
17
17
|
s.source_files = 'ios/**/*.{h,m}'
|
|
18
18
|
s.exclude_files = [ 'ios/CVDFaceSDK.h', 'ios/CVDFaceSDK.m' ]
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'FaceSDK', '6.4.2321'
|
|
20
20
|
s.dependency 'React'
|
|
21
21
|
end
|
package/android/CVDFaceSDK.kt
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
package com.regula.plugin.facesdk
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
3
4
|
import org.apache.cordova.CallbackContext
|
|
4
5
|
import org.apache.cordova.CordovaPlugin
|
|
5
|
-
import org.apache.cordova.CordovaWebView
|
|
6
6
|
import org.apache.cordova.PluginResult
|
|
7
7
|
import org.json.JSONArray
|
|
8
8
|
|
|
9
|
-
lateinit var args: JSONArray
|
|
10
|
-
lateinit var eventSender: CordovaWebView
|
|
11
9
|
val eventCallbackIds = mutableMapOf<String, String>()
|
|
12
10
|
|
|
11
|
+
lateinit var args: JSONArray
|
|
12
|
+
lateinit var binding: CordovaPlugin
|
|
13
|
+
val context: Context
|
|
14
|
+
get() = binding.cordova.context
|
|
15
|
+
|
|
13
16
|
fun sendEvent(callbackId: String, data: Any? = "") {
|
|
14
17
|
val pluginResult = PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
|
|
15
18
|
pluginResult.keepCallback = true
|
|
16
|
-
|
|
19
|
+
binding.webView.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
@Suppress("UNCHECKED_CAST")
|
|
@@ -22,9 +25,11 @@ fun <T> argsNullable(index: Int): T? = if (args.get(index).toString() != "null")
|
|
|
22
25
|
} else null
|
|
23
26
|
|
|
24
27
|
class CVDFaceSDK : CordovaPlugin() {
|
|
28
|
+
init {
|
|
29
|
+
binding = this
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
override fun execute(action: String, arguments: JSONArray, callbackContext: CallbackContext): Boolean {
|
|
26
|
-
activity = cordova.activity
|
|
27
|
-
eventSender = webView
|
|
28
33
|
args = arguments
|
|
29
34
|
val method = args.remove(0) as String
|
|
30
35
|
if (method == "setEvent") eventCallbackIds[args(0)] = callbackContext.callbackId
|
package/android/build.gradle
CHANGED
|
@@ -32,7 +32,7 @@ android {
|
|
|
32
32
|
rootProject.allprojects {
|
|
33
33
|
repositories {
|
|
34
34
|
maven {
|
|
35
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader
|
|
35
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ dependencies {
|
|
|
41
41
|
//noinspection GradleDynamicVersion
|
|
42
42
|
implementation 'com.facebook.react:react-native:+'
|
|
43
43
|
//noinspection GradleDependency
|
|
44
|
-
implementation('com.regula.face:api:
|
|
44
|
+
implementation('com.regula.face:api:6.4.3456'){
|
|
45
45
|
transitive = true
|
|
46
46
|
}
|
|
47
47
|
}
|
package/android/cordova.gradle
CHANGED
|
@@ -6,13 +6,13 @@ android {
|
|
|
6
6
|
|
|
7
7
|
repositories {
|
|
8
8
|
maven {
|
|
9
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader
|
|
9
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
dependencies {
|
|
14
14
|
//noinspection GradleDependency
|
|
15
|
-
implementation('com.regula.face:api:
|
|
15
|
+
implementation('com.regula.face:api:6.4.3456'){
|
|
16
16
|
transitive = true
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@file:Suppress("EnumValuesSoftDeprecate")
|
|
2
|
+
|
|
1
3
|
package com.regula.plugin.facesdk
|
|
2
4
|
|
|
3
5
|
import com.regula.facesdk.configuration.Customization
|
|
@@ -20,6 +22,7 @@ fun setFaceCaptureConfig(builder: FaceCaptureConfiguration.Builder, config: JSON
|
|
|
20
22
|
"closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
21
23
|
"torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
22
24
|
"vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
25
|
+
"detectOcclusion" -> builder.setDetectOcclusion(v as Boolean)
|
|
23
26
|
"cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
24
27
|
"screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
25
28
|
"timeout" -> builder.setTimeout(v.toFloat())
|
|
@@ -33,6 +36,7 @@ fun getFaceCaptureConfig(input: FaceCaptureConfiguration) = mapOf(
|
|
|
33
36
|
"closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
34
37
|
"torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
35
38
|
"vibrateOnSteps" to input.isVibrateOnSteps,
|
|
39
|
+
"detectOcclusion" to input.isDetectOcclusion,
|
|
36
40
|
"cameraPositionAndroid" to input.cameraId,
|
|
37
41
|
"screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
38
42
|
"timeout" to input.timeout,
|
|
@@ -78,11 +82,13 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
|
|
|
78
82
|
fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
79
83
|
when (k) {
|
|
80
84
|
"processingMode" -> builder.setProcessingMode(ProcessingMode.values()[v.toInt()])
|
|
85
|
+
"locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
81
86
|
}
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
fun getMatchFacesConfig(input: MatchFacesConfiguration) = mapOf(
|
|
85
|
-
"processingMode" to input.processingMode.ordinal
|
|
90
|
+
"processingMode" to input.processingMode.ordinal,
|
|
91
|
+
"locationTrackingEnabled" to input.isLocationTrackingEnabled
|
|
86
92
|
).toJson()
|
|
87
93
|
|
|
88
94
|
fun setCustomization(input: Customization, config: JSONObject) = config.forEach { key, value ->
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
package com.regula.plugin.facesdk
|
|
2
2
|
|
|
3
|
-
import android.annotation.SuppressLint
|
|
4
|
-
import android.app.Activity
|
|
5
3
|
import com.regula.plugin.facesdk.Convert.toBase64
|
|
6
4
|
import com.regula.common.LocalizationCallbacks
|
|
7
5
|
import com.regula.facesdk.FaceSDK.Instance
|
|
@@ -68,11 +66,6 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
68
66
|
inline fun <reified T> args(index: Int) = argsNullable<T>(index)!!
|
|
69
67
|
typealias Callback = (Any?) -> Unit
|
|
70
68
|
|
|
71
|
-
@SuppressLint("StaticFieldLeak")
|
|
72
|
-
lateinit var activity: Activity
|
|
73
|
-
val context
|
|
74
|
-
get() = activity
|
|
75
|
-
|
|
76
69
|
const val cameraSwitchEvent = "cameraSwitchEvent"
|
|
77
70
|
const val livenessNotificationEvent = "livenessNotificationEvent"
|
|
78
71
|
const val videoEncoderCompletionEvent = "video_encoder_completion"
|
|
@@ -136,11 +129,13 @@ fun stopLiveness() = Instance().stopLivenessProcessing(context)
|
|
|
136
129
|
|
|
137
130
|
fun matchFaces(callback: Callback, request: JSONObject, config: JSONObject?) = config?.let {
|
|
138
131
|
Instance().matchFaces(
|
|
132
|
+
context,
|
|
139
133
|
matchFacesRequestFromJSON(request),
|
|
140
134
|
matchFacesConfigFromJSON(it),
|
|
141
135
|
matchFacesCompletion(callback)
|
|
142
136
|
)
|
|
143
137
|
} ?: Instance().matchFaces(
|
|
138
|
+
context,
|
|
144
139
|
matchFacesRequestFromJSON(request),
|
|
145
140
|
matchFacesCompletion(callback)
|
|
146
141
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.regula.plugin.facesdk
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
3
4
|
import com.facebook.react.ReactPackage
|
|
4
5
|
import com.facebook.react.bridge.Promise
|
|
5
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -13,13 +14,16 @@ import org.json.JSONArray
|
|
|
13
14
|
import org.json.JSONObject
|
|
14
15
|
|
|
15
16
|
var listenerCount = 0
|
|
17
|
+
|
|
16
18
|
lateinit var args: JSONArray
|
|
17
|
-
lateinit var
|
|
19
|
+
lateinit var binding: ReactContext
|
|
20
|
+
val context: Context
|
|
21
|
+
get() = binding.applicationContext
|
|
18
22
|
|
|
19
23
|
fun sendEvent(event: String, data: Any? = "") {
|
|
20
24
|
if (listenerCount <= 0) return
|
|
21
25
|
val result = if (data is JSONObject || data is JSONArray) data.toString() else data.toString() + ""
|
|
22
|
-
|
|
26
|
+
binding.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java).emit(event, result)
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
@Suppress("UNCHECKED_CAST")
|
|
@@ -30,15 +34,16 @@ fun <T> argsNullable(index: Int): T? {
|
|
|
30
34
|
return value as T
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
@Suppress("unused")
|
|
33
38
|
class RNFaceSDKPackage : ReactPackage {
|
|
34
39
|
override fun createNativeModules(rc: ReactApplicationContext) = listOf(RNFaceSDKModule(rc))
|
|
35
40
|
override fun createViewManagers(rc: ReactApplicationContext) = emptyList<ViewManager<*, *>>()
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
@Suppress("unused", "UNUSED_PARAMETER")
|
|
39
|
-
class RNFaceSDKModule(
|
|
44
|
+
class RNFaceSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
40
45
|
init {
|
|
41
|
-
|
|
46
|
+
binding = reactContext
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
@ReactMethod
|
|
@@ -54,7 +59,6 @@ class RNFaceSDKModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(
|
|
|
54
59
|
@ReactMethod
|
|
55
60
|
fun exec(method: String, arguments: ReadableArray, promise: Promise) {
|
|
56
61
|
args = JSONArray(arguments.toArrayList())
|
|
57
|
-
reactContext.currentActivity?.let { activity = it }
|
|
58
62
|
methodCall(method) { data -> promise.resolve(data.toSendable()) }
|
|
59
63
|
}
|
|
60
64
|
override fun getName() = "RNFaceSDK"
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
android {
|
|
4
4
|
compileOptions {
|
|
5
|
-
sourceCompatibility JavaVersion.
|
|
6
|
-
targetCompatibility JavaVersion.
|
|
5
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
6
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
|
11
11
|
dependencies {
|
|
12
12
|
implementation project(':capacitor-app')
|
|
13
|
+
implementation project(':capacitor-dialog')
|
|
13
14
|
implementation project(':capacitor-haptics')
|
|
14
15
|
implementation project(':capacitor-keyboard')
|
|
15
16
|
implementation project(':capacitor-status-bar')
|
|
16
|
-
|
|
17
|
+
implementation "androidx.core:core:1.6.+"
|
|
18
|
+
implementation "androidx.webkit:webkit:1.4.0"
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
|
|
20
21
|
if (hasProperty('postBuildExtras')) {
|
|
21
22
|
postBuildExtras()
|
|
22
23
|
}
|
|
@@ -5,6 +5,9 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
|
|
|
5
5
|
include ':capacitor-app'
|
|
6
6
|
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
|
|
7
7
|
|
|
8
|
+
include ':capacitor-dialog'
|
|
9
|
+
project(':capacitor-dialog').projectDir = new File('../node_modules/@capacitor/dialog/android')
|
|
10
|
+
|
|
8
11
|
include ':capacitor-haptics'
|
|
9
12
|
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
|
|
10
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
6
6
|
zipStorePath=wrapper/dists
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
minSdkVersion =
|
|
3
|
-
compileSdkVersion =
|
|
4
|
-
targetSdkVersion =
|
|
5
|
-
androidxActivityVersion = '1.
|
|
6
|
-
androidxAppCompatVersion = '1.
|
|
2
|
+
minSdkVersion = 23
|
|
3
|
+
compileSdkVersion = 35
|
|
4
|
+
targetSdkVersion = 35
|
|
5
|
+
androidxActivityVersion = '1.9.2'
|
|
6
|
+
androidxAppCompatVersion = '1.7.0'
|
|
7
7
|
androidxCoordinatorLayoutVersion = '1.2.0'
|
|
8
|
-
androidxCoreVersion = '1.
|
|
9
|
-
androidxFragmentVersion = '1.
|
|
10
|
-
coreSplashScreenVersion = '1.0.
|
|
11
|
-
androidxWebkitVersion = '1.
|
|
8
|
+
androidxCoreVersion = '1.15.0'
|
|
9
|
+
androidxFragmentVersion = '1.8.4'
|
|
10
|
+
coreSplashScreenVersion = '1.0.1'
|
|
11
|
+
androidxWebkitVersion = '1.12.1'
|
|
12
12
|
junitVersion = '4.13.2'
|
|
13
|
-
androidxJunitVersion = '1.1
|
|
14
|
-
androidxEspressoCoreVersion = '3.
|
|
15
|
-
cordovaAndroidVersion = '
|
|
13
|
+
androidxJunitVersion = '1.2.1'
|
|
14
|
+
androidxEspressoCoreVersion = '3.6.1'
|
|
15
|
+
cordovaAndroidVersion = '10.1.1'
|
|
16
16
|
}
|
|
@@ -12,6 +12,7 @@ def capacitor_pods
|
|
|
12
12
|
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
|
13
13
|
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
|
14
14
|
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
|
|
15
|
+
pod 'CapacitorDialog', :path => '../../node_modules/@capacitor/dialog'
|
|
15
16
|
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
|
16
17
|
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
|
17
18
|
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
|
|
@@ -15,34 +15,33 @@
|
|
|
15
15
|
"lint": "eslint"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
19
|
-
"@regulaforensics/face-core-basic": "6.
|
|
20
|
-
"@awesome-cordova-plugins/camera": "6.
|
|
21
|
-
"@awesome-cordova-plugins/file": "6.
|
|
22
|
-
"@
|
|
23
|
-
"@capacitor/
|
|
24
|
-
"@capacitor/core": "7.0.0
|
|
25
|
-
"@capacitor/
|
|
26
|
-
"@capacitor/
|
|
27
|
-
"@capacitor/
|
|
28
|
-
"@capacitor/keyboard": "7.0.0
|
|
29
|
-
"@capacitor/status-bar": "7.0.0
|
|
18
|
+
"@regulaforensics/face-sdk": "6.5.97-beta",
|
|
19
|
+
"@regulaforensics/face-core-basic": "6.5.55-beta",
|
|
20
|
+
"@awesome-cordova-plugins/camera": "6.14.0",
|
|
21
|
+
"@awesome-cordova-plugins/file": "6.14.0",
|
|
22
|
+
"@capacitor/android": "^7.0.0",
|
|
23
|
+
"@capacitor/app": "^7.0.0",
|
|
24
|
+
"@capacitor/core": "^7.0.0",
|
|
25
|
+
"@capacitor/dialog": "^7.0.0",
|
|
26
|
+
"@capacitor/haptics": "^7.0.0",
|
|
27
|
+
"@capacitor/ios": "^7.0.0",
|
|
28
|
+
"@capacitor/keyboard": "^7.0.0",
|
|
29
|
+
"@capacitor/status-bar": "^7.0.0",
|
|
30
30
|
"@ionic/react": "^7.0.0",
|
|
31
31
|
"@ionic/react-router": "^7.0.0",
|
|
32
32
|
"@types/react-router": "^5.1.20",
|
|
33
33
|
"@types/react-router-dom": "^5.3.3",
|
|
34
|
-
"cordova-plugin-camera": "
|
|
35
|
-
"cordova-plugin-file": "8.
|
|
36
|
-
"cordova-plugin-dialogs": "^2.0.2",
|
|
37
|
-
"jetifier": "2.0.0",
|
|
34
|
+
"cordova-plugin-camera": "8.0.0",
|
|
35
|
+
"cordova-plugin-file": "8.1.3",
|
|
38
36
|
"ionicons": "^7.0.0",
|
|
37
|
+
"jetifier": "2.0.0",
|
|
39
38
|
"react": "^18.2.0",
|
|
40
39
|
"react-dom": "^18.2.0",
|
|
41
40
|
"react-router": "^5.3.4",
|
|
42
41
|
"react-router-dom": "^5.3.4"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
45
|
-
"@capacitor/cli": "7.0.0
|
|
44
|
+
"@capacitor/cli": "^7.0.0",
|
|
46
45
|
"@testing-library/dom": ">=7.21.4",
|
|
47
46
|
"@testing-library/jest-dom": "^5.16.5",
|
|
48
47
|
"@testing-library/react": "^14.0.0",
|
|
@@ -59,6 +58,5 @@
|
|
|
59
58
|
"typescript": "^5.1.6",
|
|
60
59
|
"vite": "^5.0.0",
|
|
61
60
|
"vitest": "^0.34.6"
|
|
62
|
-
}
|
|
63
|
-
"description": "An Ionic project"
|
|
61
|
+
}
|
|
64
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IonPage } from '@ionic/react'
|
|
2
2
|
import React from "react"
|
|
3
3
|
import { File } from '@awesome-cordova-plugins/file'
|
|
4
|
-
import {
|
|
4
|
+
import { Dialog } from '@capacitor/dialog'
|
|
5
5
|
import { Camera, DestinationType, MediaType, PictureSourceType } from '@awesome-cordova-plugins/camera'
|
|
6
6
|
import { FaceSDK, MatchFacesRequest, MatchFacesImage, InitConfig, LivenessSkipStep, ImageType, LivenessStatus, LivenessConfig } from '@regulaforensics/face-sdk'
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ async function startLiveness() {
|
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
if (response.image == null) return
|
|
23
|
-
setImage(response.image, ImageType.LIVE, 1)
|
|
23
|
+
setImage("data:image/png;base64," + response.image, ImageType.LIVE, 1)
|
|
24
24
|
setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -69,12 +69,12 @@ function setImage(base64: string, type: number, position: number) {
|
|
|
69
69
|
var mfImage = new MatchFacesImage(base64, type)
|
|
70
70
|
if (position == 1) {
|
|
71
71
|
image1 = mfImage
|
|
72
|
-
setUiImage1(
|
|
72
|
+
setUiImage1(base64)
|
|
73
73
|
setLivenessStatus("null")
|
|
74
74
|
}
|
|
75
75
|
if (position == 2) {
|
|
76
76
|
image2 = mfImage
|
|
77
|
-
setUiImage2(
|
|
77
|
+
setUiImage2(base64)
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -82,22 +82,26 @@ async function useCamera(position: number) {
|
|
|
82
82
|
var response = await faceSdk.startFaceCapture()
|
|
83
83
|
if (response.image == null) return
|
|
84
84
|
var image = response.image
|
|
85
|
-
setImage(image.image, image.imageType, position)
|
|
85
|
+
setImage("data:image/png;base64," + image.image, image.imageType, position)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function useGallery(position: number) {
|
|
89
|
-
Camera.getPicture({
|
|
88
|
+
async function useGallery(position: number) {
|
|
89
|
+
var image = await Camera.getPicture({
|
|
90
90
|
destinationType: DestinationType.DATA_URL,
|
|
91
91
|
mediaType: MediaType.PICTURE,
|
|
92
92
|
sourceType: PictureSourceType.PHOTOLIBRARY
|
|
93
|
-
})
|
|
93
|
+
})
|
|
94
|
+
setImage(image, ImageType.PRINTED, position)
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
function pickImage(position: number) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
async function pickImage(position: number) {
|
|
98
|
+
var response = await Dialog.confirm({
|
|
99
|
+
message: "Select option",
|
|
100
|
+
okButtonTitle: "Use camera",
|
|
101
|
+
cancelButtonTitle: "Use gallery"
|
|
100
102
|
})
|
|
103
|
+
if (response.value) useCamera(position)
|
|
104
|
+
else useGallery(position)
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"android": "scripts/android.sh"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
13
|
-
"@regulaforensics/face-core-basic": "6.
|
|
12
|
+
"@regulaforensics/face-sdk": "6.5.97-beta",
|
|
13
|
+
"@regulaforensics/face-core-basic": "6.5.55-beta",
|
|
14
14
|
"cordova-android": "13.0.0",
|
|
15
15
|
"cordova-ios": "7.1.1",
|
|
16
16
|
"cordova-plugin-add-swift-support": "2.0.2",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"private": true,
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
20
|
-
"@regulaforensics/face-core-basic": "6.
|
|
19
|
+
"@regulaforensics/face-sdk": "6.5.97-beta",
|
|
20
|
+
"@regulaforensics/face-core-basic": "6.5.55-beta",
|
|
21
21
|
"cordova-plugin-camera": "8.0.0",
|
|
22
22
|
"@awesome-cordova-plugins/camera": "6.14.0",
|
|
23
23
|
"@awesome-cordova-plugins/core": "6.14.0",
|
|
@@ -20,7 +20,7 @@ async function startLiveness() {
|
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
if (response.image == null) return
|
|
23
|
-
setImage(response.image, ImageType.LIVE, 1)
|
|
23
|
+
setImage("data:image/png;base64," + response.image, ImageType.LIVE, 1)
|
|
24
24
|
setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -69,12 +69,12 @@ function setImage(base64: string, type: number, position: number) {
|
|
|
69
69
|
var mfImage = new MatchFacesImage(base64, type)
|
|
70
70
|
if (position == 1) {
|
|
71
71
|
image1 = mfImage
|
|
72
|
-
setUiImage1(
|
|
72
|
+
setUiImage1(base64)
|
|
73
73
|
setLivenessStatus("null")
|
|
74
74
|
}
|
|
75
75
|
if (position == 2) {
|
|
76
76
|
image2 = mfImage
|
|
77
|
-
setUiImage2(
|
|
77
|
+
setUiImage2(base64)
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -82,22 +82,22 @@ async function useCamera(position: number) {
|
|
|
82
82
|
var response = await faceSdk.startFaceCapture()
|
|
83
83
|
if (response.image == null) return
|
|
84
84
|
var image = response.image
|
|
85
|
-
setImage(image.image, image.imageType, position)
|
|
85
|
+
setImage("data:image/png;base64," + image.image, image.imageType, position)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function useGallery(position: number) {
|
|
89
|
-
app.camera.getPicture({
|
|
88
|
+
async function useGallery(position: number) {
|
|
89
|
+
var image = await app.camera.getPicture({
|
|
90
90
|
destinationType: DestinationType.DATA_URL,
|
|
91
91
|
mediaType: MediaType.PICTURE,
|
|
92
92
|
sourceType: PictureSourceType.PHOTOLIBRARY
|
|
93
|
-
})
|
|
93
|
+
})
|
|
94
|
+
setImage(image, ImageType.PRINTED, position)
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
function pickImage(position: number) {
|
|
97
|
-
app.dialogs.confirm("", "Select option", ["Use gallery", "Use camera"])
|
|
98
|
-
|
|
97
|
+
async function pickImage(position: number) {
|
|
98
|
+
var option = await app.dialogs.confirm("", "Select option", ["Use gallery", "Use camera"])
|
|
99
|
+
if (option == 1) useGallery(position)
|
|
99
100
|
else useCamera(position)
|
|
100
|
-
})
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"test": "jest"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@regulaforensics/face-sdk": "6.5.
|
|
15
|
-
"@regulaforensics/face-core-basic": "6.
|
|
14
|
+
"@regulaforensics/face-sdk": "6.5.97-beta",
|
|
15
|
+
"@regulaforensics/face-core-basic": "6.5.55-beta",
|
|
16
16
|
"react": "18.3.1",
|
|
17
17
|
"react-native": "0.76.6",
|
|
18
18
|
"react-native-fs": "2.20.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/face-sdk",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.97-beta",
|
|
4
4
|
"description": "This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.",
|
|
5
5
|
"main": "www/react-native/index.js",
|
|
6
6
|
"module": "www/capacitor/index.js",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/face-sdk" version="6.5.
|
|
2
|
+
<plugin id="@regulaforensics/face-sdk" version="6.5.97-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>FaceSDK</name>
|
|
4
4
|
<description>Cordova plugin for Regula Face SDK</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<config>
|
|
29
29
|
</config>
|
|
30
30
|
<pods>
|
|
31
|
-
<pod name="
|
|
31
|
+
<pod name="FaceSDK" spec="6.4.2321" />
|
|
32
32
|
</pods>
|
|
33
33
|
</podspec>
|
|
34
34
|
</platform>
|