@regulaforensics/face-sdk 8.3.1209-rc → 8.3.1212-nightly
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/build.gradle +2 -2
- package/android/cordova.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +90 -90
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +98 -98
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +35 -35
- package/examples/capacitor/package.json +2 -2
- package/examples/ionic/package.json +2 -2
- package/examples/react_native/package.json +2 -2
- package/ios/Config.swift +105 -105
- package/ios/Decoder.swift +67 -67
- package/ios/Main.swift +22 -22
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/test/package-lock.json +2 -5
- package/test/test.tsx +15 -15
- package/www/types/index.d.ts +24 -24
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 = '8.3.
|
|
8
|
+
s.version = '8.3.1212-nightly'
|
|
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 = '13.0'
|
|
17
17
|
s.source_files = [ 'ios/**/*.swift', 'ios/**/RN*.m' ]
|
|
18
18
|
s.exclude_files = [ 'ios/CDVFaceSDK.swift' ]
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'FaceSDKNightly', '8.3.4690'
|
|
20
20
|
s.dependency 'React'
|
|
21
21
|
end
|
package/android/build.gradle
CHANGED
|
@@ -20,7 +20,7 @@ android {
|
|
|
20
20
|
rootProject.allprojects {
|
|
21
21
|
repositories {
|
|
22
22
|
maven {
|
|
23
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader/
|
|
23
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ dependencies {
|
|
|
29
29
|
//noinspection GradleDynamicVersion
|
|
30
30
|
implementation 'com.facebook.react:react-native:+'
|
|
31
31
|
//noinspection GradleDependency
|
|
32
|
-
implementation('com.regula.face:api:8.3.
|
|
32
|
+
implementation('com.regula.face:api:8.3.5174'){
|
|
33
33
|
transitive = true
|
|
34
34
|
}
|
|
35
35
|
}
|
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/Nightly"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
dependencies {
|
|
14
14
|
//noinspection GradleDependency
|
|
15
|
-
implementation('com.regula.face:api:8.3.
|
|
15
|
+
implementation('com.regula.face:api:8.3.5174'){
|
|
16
16
|
transitive = true
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
package com.regula.plugin.facesdk
|
|
4
4
|
|
|
5
5
|
import com.regula.facesdk.configuration.Customization
|
|
6
|
-
|
|
6
|
+
import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
7
7
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
8
8
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
9
9
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
10
|
-
|
|
10
|
+
import com.regula.facesdk.configuration.VerificationConfiguration
|
|
11
11
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
12
12
|
import com.regula.facesdk.detection.request.ImageQualityGroup
|
|
13
13
|
import com.regula.facesdk.detection.request.ImageQualityRange
|
|
@@ -87,94 +87,94 @@ fun getLivenessConfig(input: LivenessConfiguration) = mapOf(
|
|
|
87
87
|
"metadata" to input.metadata,
|
|
88
88
|
).toJson()
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
90
|
+
fun setEnrollmentConfig(builder: EnrollmentConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
91
|
+
when (k) {
|
|
92
|
+
"copyright" -> builder.setCopyright(v as Boolean)
|
|
93
|
+
"cameraSwitchEnabled" -> builder.setCameraSwitchEnabled(v as Boolean)
|
|
94
|
+
"closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
95
|
+
"torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
96
|
+
"vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
97
|
+
"cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
98
|
+
"screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
99
|
+
"locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
100
|
+
"preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
|
|
101
|
+
"attemptsCount" -> builder.setAttemptsCount(v.toInt())
|
|
102
|
+
"recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
|
|
103
|
+
"livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
|
|
104
|
+
"tag" -> builder.setTag(v as String)
|
|
105
|
+
"externalId" -> builder.setExternalId(v as String)
|
|
106
|
+
"groupId" -> builder.setGroupId(v as String)
|
|
107
|
+
"duplicatesThreshold" -> if (config.getBooleanOrNull("checkDuplicatesEnabled") == true) builder.enableCheckDuplicates(v.toFloat())
|
|
108
|
+
"skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
|
|
109
|
+
"metadata" -> builder.setMetadata(v as JSONObject)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
fun getEnrollmentConfig(input: EnrollmentConfiguration) = mapOf(
|
|
114
|
+
"copyright" to input.hasCopyright(),
|
|
115
|
+
"cameraSwitchEnabled" to input.isCameraSwitchEnabled,
|
|
116
|
+
"closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
117
|
+
"torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
118
|
+
"vibrateOnSteps" to input.isVibrateOnSteps,
|
|
119
|
+
"cameraPositionAndroid" to input.cameraId,
|
|
120
|
+
"screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
121
|
+
"locationTrackingEnabled" to input.isLocationTrackingEnabled,
|
|
122
|
+
"preventScreenRecording" to input.doPreventScreenRecording(),
|
|
123
|
+
"attemptsCount" to input.attemptsCount,
|
|
124
|
+
"recordingProcess" to input.recordingProcess.ordinal,
|
|
125
|
+
"livenessType" to input.type.ordinal,
|
|
126
|
+
"tag" to input.tag,
|
|
127
|
+
"externalId" to input.externalId,
|
|
128
|
+
"groupId" to input.groupId,
|
|
129
|
+
"checkDuplicatesEnabled" to input.isCheckDuplicatesEnabled,
|
|
130
|
+
"duplicatesThreshold" to input.duplicatesThreshold,
|
|
131
|
+
"skipStep" to generateLivenessSkipStepArray(input.skipStep),
|
|
132
|
+
"metadata" to input.metadata,
|
|
133
|
+
).toJson()
|
|
134
|
+
|
|
135
|
+
fun setVerificationConfig(builder: VerificationConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
136
|
+
when (k) {
|
|
137
|
+
"copyright" -> builder.setCopyright(v as Boolean)
|
|
138
|
+
"cameraSwitchEnabled" -> builder.setCameraSwitchEnabled(v as Boolean)
|
|
139
|
+
"closeButtonEnabled" -> builder.setCloseButtonEnabled(v as Boolean)
|
|
140
|
+
"torchButtonEnabled" -> builder.setTorchButtonEnabled(v as Boolean)
|
|
141
|
+
"vibrateOnSteps" -> builder.setVibrateOnStep(v as Boolean)
|
|
142
|
+
"cameraPositionAndroid" -> builder.setCameraId(v.toInt())
|
|
143
|
+
"screenOrientation" -> builder.setScreenOrientation(*screenOrientationArrayFromJSON(v as JSONArray))
|
|
144
|
+
"locationTrackingEnabled" -> builder.setLocationTrackingEnabled(v as Boolean)
|
|
145
|
+
"preventScreenRecording" -> builder.setPreventScreenRecording(v as Boolean)
|
|
146
|
+
"attemptsCount" -> builder.setAttemptsCount(v.toInt())
|
|
147
|
+
"recordingProcess" -> builder.setRecordingProcess(RecordingProcess.values()[v.toInt()])
|
|
148
|
+
"livenessType" -> builder.setType(LivenessType.values()[v.toInt()])
|
|
149
|
+
"tag" -> builder.setTag(v as String)
|
|
150
|
+
"personId" -> builder.setPrivateProperty("u", v as String)
|
|
151
|
+
"groupId" -> builder.setGroupId(v as String)
|
|
152
|
+
"threshold" -> builder.setThreshold(v.toFloat())
|
|
153
|
+
"skipStep" -> builder.setSkipStep(*livenessSkipStepArrayFromJSON(v as JSONArray))
|
|
154
|
+
"metadata" -> builder.setMetadata(v as JSONObject)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
fun getVerificationConfig(input: VerificationConfiguration) = mapOf(
|
|
159
|
+
"copyright" to input.hasCopyright(),
|
|
160
|
+
"cameraSwitchEnabled" to input.isCameraSwitchEnabled,
|
|
161
|
+
"closeButtonEnabled" to input.isCloseButtonEnabled,
|
|
162
|
+
"torchButtonEnabled" to input.isTorchButtonEnabled,
|
|
163
|
+
"vibrateOnSteps" to input.isVibrateOnSteps,
|
|
164
|
+
"cameraPositionAndroid" to input.cameraId,
|
|
165
|
+
"screenOrientation" to generateScreenOrientationArray(input.screenOrientation),
|
|
166
|
+
"locationTrackingEnabled" to input.isLocationTrackingEnabled,
|
|
167
|
+
"preventScreenRecording" to input.doPreventScreenRecording(),
|
|
168
|
+
"attemptsCount" to input.attemptsCount,
|
|
169
|
+
"recordingProcess" to input.recordingProcess.ordinal,
|
|
170
|
+
"livenessType" to input.type.ordinal,
|
|
171
|
+
"tag" to input.tag,
|
|
172
|
+
"personId" to input.personId,
|
|
173
|
+
"groupId" to input.groupId,
|
|
174
|
+
"threshold" to input.threshold,
|
|
175
|
+
"skipStep" to generateLivenessSkipStepArray(input.skipStep),
|
|
176
|
+
"metadata" to input.metadata,
|
|
177
|
+
).toJson()
|
|
178
178
|
|
|
179
179
|
fun setMatchFacesConfig(builder: MatchFacesConfiguration.Builder, config: JSONObject) = config.forEach { k, v ->
|
|
180
180
|
when (k) {
|
|
@@ -9,12 +9,12 @@ import android.graphics.Rect
|
|
|
9
9
|
import android.graphics.Typeface
|
|
10
10
|
import android.util.Pair
|
|
11
11
|
import android.util.Size
|
|
12
|
-
|
|
12
|
+
import com.regula.facesdk.configuration.EnrollmentConfiguration
|
|
13
13
|
import com.regula.facesdk.configuration.FaceCaptureConfiguration
|
|
14
14
|
import com.regula.facesdk.configuration.InitializationConfiguration
|
|
15
15
|
import com.regula.facesdk.configuration.LivenessConfiguration
|
|
16
16
|
import com.regula.facesdk.configuration.MatchFacesConfiguration
|
|
17
|
-
|
|
17
|
+
import com.regula.facesdk.configuration.VerificationConfiguration
|
|
18
18
|
import com.regula.facesdk.detection.request.DetectFacesConfiguration
|
|
19
19
|
import com.regula.facesdk.detection.request.DetectFacesRequest
|
|
20
20
|
import com.regula.facesdk.detection.request.ImageQualityCharacteristic
|
|
@@ -52,13 +52,13 @@ import com.regula.facesdk.exception.UnderlineException
|
|
|
52
52
|
import com.regula.facesdk.model.Image
|
|
53
53
|
import com.regula.facesdk.model.LivenessNotification
|
|
54
54
|
import com.regula.facesdk.model.MatchFacesImage
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
import com.regula.facesdk.model.results.EnrollmentResponse
|
|
56
|
+
import com.regula.facesdk.model.results.ErrorResponse
|
|
57
57
|
import com.regula.facesdk.model.results.FaceCaptureResponse
|
|
58
58
|
import com.regula.facesdk.model.results.FaceSDKVersion
|
|
59
59
|
import com.regula.facesdk.model.results.LivenessResponse
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
import com.regula.facesdk.model.results.VerificationResponse
|
|
61
|
+
import com.regula.facesdk.model.results.VerificationMatchResponse
|
|
62
62
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFace
|
|
63
63
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesComparedFacesPair
|
|
64
64
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesDetection
|
|
@@ -71,7 +71,7 @@ import com.regula.facesdk.model.results.person.PersonImage
|
|
|
71
71
|
import com.regula.facesdk.model.results.person.SearchPerson
|
|
72
72
|
import com.regula.facesdk.model.results.person.SearchPerson.Detection
|
|
73
73
|
import com.regula.facesdk.model.results.person.SearchPersonImage
|
|
74
|
-
|
|
74
|
+
import com.regula.facesdk.request.EnrollmentRequest
|
|
75
75
|
import com.regula.facesdk.request.MatchFacesRequest
|
|
76
76
|
import com.regula.facesdk.request.person.EditGroupPersonsRequest
|
|
77
77
|
import com.regula.facesdk.request.person.ImageUpload
|
|
@@ -110,21 +110,21 @@ fun livenessConfigFromJSON(input: JSONObject) = input.let {
|
|
|
110
110
|
|
|
111
111
|
fun generateLivenessConfig(input: LivenessConfiguration) = getLivenessConfig(input)
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
113
|
+
fun enrollmentConfigFromJSON(input: JSONObject) = input.let {
|
|
114
|
+
val result = EnrollmentConfiguration.Builder("")
|
|
115
|
+
setEnrollmentConfig(result, it)
|
|
116
|
+
result.build()
|
|
117
|
+
}!!
|
|
118
|
+
|
|
119
|
+
fun generateEnrollmentConfig(input: EnrollmentConfiguration) = getEnrollmentConfig(input)
|
|
120
|
+
|
|
121
|
+
fun verificationConfigFromJSON(input: JSONObject) = input.let {
|
|
122
|
+
val result = VerificationConfiguration.Builder("")
|
|
123
|
+
setVerificationConfig(result, it)
|
|
124
|
+
result.build()
|
|
125
|
+
}!!
|
|
126
|
+
|
|
127
|
+
fun generateVerificationConfig(input: VerificationConfiguration) = getVerificationConfig(input)
|
|
128
128
|
|
|
129
129
|
fun matchFacesConfigFromJSON(input: JSONObject) = input.let {
|
|
130
130
|
val result = MatchFacesConfiguration.Builder()
|
|
@@ -365,23 +365,23 @@ fun generateFaceCaptureResponse(it: FaceCaptureResponse) = mapOf(
|
|
|
365
365
|
|
|
366
366
|
// Liveness ------------------------------
|
|
367
367
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
368
|
+
fun enrollmentRequestFromJSON(input: JSONObject): EnrollmentRequest = input.let {
|
|
369
|
+
val externalId = it.getString("externalId")
|
|
370
|
+
val builder = if (it.has("trustedImage")) EnrollmentRequest.Builder(externalId, it.getString("trustedImage").toBitmap()!!)
|
|
371
|
+
else EnrollmentRequest.Builder(externalId, it.getString("trustedImageUrl"))
|
|
372
|
+
|
|
373
|
+
if (it.has("groupId")) builder.setGroupId(it.getString("groupId"))
|
|
374
|
+
builder.build()
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
fun generateEnrollmentRequest(input: EnrollmentRequest) = input.let {
|
|
378
|
+
mapOf(
|
|
379
|
+
"externalId" to it.externalId,
|
|
380
|
+
"groupId" to it.groupId,
|
|
381
|
+
"trustedImage" to it.trustedImage.toBase64(),
|
|
382
|
+
"trustedImageUrl" to it.trustedImageUrl,
|
|
383
|
+
).toJson()
|
|
384
|
+
}
|
|
385
385
|
|
|
386
386
|
fun livenessResponseFromJSON(input: JSONObject?) = input?.let {
|
|
387
387
|
val result = LivenessResponse()
|
|
@@ -417,65 +417,65 @@ fun generateLivenessNotification(it: LivenessNotification) = mapOf(
|
|
|
417
417
|
"response" to generateLivenessResponse(it.response)
|
|
418
418
|
).toJson()
|
|
419
419
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
420
|
+
fun errorResponseFromJSON(input: JSONObject?) = input?.let {
|
|
421
|
+
ErrorResponse(
|
|
422
|
+
it.getInt("code"),
|
|
423
|
+
it.getString("message")
|
|
424
|
+
)
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
fun generateErrorResponse(input: ErrorResponse?) = input?.let {
|
|
428
|
+
mapOf(
|
|
429
|
+
"code" to it.code,
|
|
430
|
+
"message" to it.message
|
|
431
|
+
).toJson()
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
fun enrollmentResponseFromJSON(input: JSONObject?) = input?.let {
|
|
435
|
+
EnrollmentResponse(
|
|
436
|
+
it.getStringOrNull("personId"),
|
|
437
|
+
it.getStringOrNull("externalId"),
|
|
438
|
+
errorResponseFromJSON(it.getJSONObjectOrNull("error"))
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
fun generateEnrollmentResponse(input: EnrollmentResponse?) = input?.let {
|
|
443
|
+
mapOf(
|
|
444
|
+
"personId" to it.personId,
|
|
445
|
+
"externalId" to it.externalId,
|
|
446
|
+
"error" to generateErrorResponse(it.errorResponse),
|
|
447
|
+
).toJson()
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
fun verifyMatchResponseFromJSON(input: JSONObject?) = input?.let {
|
|
451
|
+
VerificationMatchResponse(
|
|
452
|
+
it.getBoolean("passed"),
|
|
453
|
+
it.get("similarity").toFloat()
|
|
454
|
+
)
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
fun generateVerifyMatchResponse(input: VerificationMatchResponse?) = input?.let {
|
|
458
|
+
mapOf(
|
|
459
|
+
"passed" to it.isPassed,
|
|
460
|
+
"similarity" to it.similarity
|
|
461
|
+
).toJson()
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
fun verificationResponseFromJSON(input: JSONObject?) = input?.let {
|
|
465
|
+
VerificationResponse(
|
|
466
|
+
it.getBoolean("passed"),
|
|
467
|
+
verifyMatchResponseFromJSON(it.getJSONObjectOrNull("match")),
|
|
468
|
+
errorResponseFromJSON(it.getJSONObjectOrNull("error"))
|
|
469
|
+
)
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
fun generateVerificationResponse(input: VerificationResponse?) = input?.let {
|
|
473
|
+
mapOf(
|
|
474
|
+
"passed" to it.isPassed,
|
|
475
|
+
"match" to generateVerifyMatchResponse(it.match),
|
|
476
|
+
"error" to generateErrorResponse(it.error),
|
|
477
|
+
).toJson()
|
|
478
|
+
}
|
|
479
479
|
|
|
480
480
|
// MatchFaces ------------------------------
|
|
481
481
|
|
|
@@ -16,9 +16,9 @@ import com.regula.facesdk.enums.InitErrorCode
|
|
|
16
16
|
import com.regula.facesdk.exception.InitException
|
|
17
17
|
import com.regula.facesdk.listener.NetworkInterceptorListener
|
|
18
18
|
import com.regula.facesdk.model.LivenessNotification
|
|
19
|
-
|
|
19
|
+
import com.regula.facesdk.model.results.EnrollmentResponse
|
|
20
20
|
import com.regula.facesdk.model.results.LivenessResponse
|
|
21
|
-
|
|
21
|
+
import com.regula.facesdk.model.results.VerificationResponse
|
|
22
22
|
import com.regula.facesdk.model.results.matchfaces.MatchFacesSimilarityThresholdSplit
|
|
23
23
|
import com.regula.facesdk.model.results.person.DbBaseItem
|
|
24
24
|
import com.regula.facesdk.model.results.person.PageableItemList
|
|
@@ -48,9 +48,9 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
48
48
|
"startFaceCapture" -> startFaceCapture(callback, argsNullable(0))
|
|
49
49
|
"stopFaceCapture" -> stopFaceCapture()
|
|
50
50
|
"startLiveness" -> startLiveness(callback, argsNullable(0))
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
"startEnrollment" -> startEnrollment(callback, args(0))
|
|
52
|
+
"startVerification" -> startVerification(callback, args(0))
|
|
53
|
+
"enrollWithTrustedPhoto" -> enrollWithTrustedPhoto(callback, args(0))
|
|
54
54
|
"stopLiveness" -> stopLiveness()
|
|
55
55
|
"matchFaces" -> matchFaces(callback, args(0), argsNullable(1))
|
|
56
56
|
"splitComparedFaces" -> splitComparedFaces(callback, args(0), args(1))
|
|
@@ -160,23 +160,23 @@ fun startLiveness(callback: Callback, config: JSONObject?) = config?.let {
|
|
|
160
160
|
livenessNotificationCompletion()
|
|
161
161
|
)
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
163
|
+
fun startEnrollment(callback: Callback, config: JSONObject) = Instance().startEnrollment(
|
|
164
|
+
context,
|
|
165
|
+
enrollmentConfigFromJSON(config),
|
|
166
|
+
enrollmentCompletion(callback),
|
|
167
|
+
livenessNotificationCompletion(),
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
fun startVerification(callback: Callback, config: JSONObject) = Instance().startVerification(
|
|
171
|
+
context,
|
|
172
|
+
verificationConfigFromJSON(config),
|
|
173
|
+
verificationCompletion(callback),
|
|
174
|
+
livenessNotificationCompletion(),
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
fun enrollWithTrustedPhoto(callback: Callback, config: JSONObject) = Instance().enrollWithTrustedPhoto(
|
|
178
|
+
enrollmentRequestFromJSON(config),
|
|
179
|
+
) { callback(generateEnrollmentResponse(it)) }
|
|
180
180
|
|
|
181
181
|
fun stopLiveness() = Instance().stopLivenessProcessing(context)
|
|
182
182
|
|
|
@@ -395,19 +395,19 @@ fun detectFacesCompletion(callback: Callback) = DetectFacesCompletion {
|
|
|
395
395
|
callback(generateDetectFacesResponse(it))
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
398
|
+
fun verificationCompletion(callback: Callback) = { livenessResponse: LivenessResponse, verificationResponse: VerificationResponse? ->
|
|
399
|
+
callback(mapOf(
|
|
400
|
+
"livenessResponse" to generateLivenessResponse(livenessResponse),
|
|
401
|
+
"verificationResponse" to generateVerificationResponse(verificationResponse),
|
|
402
|
+
).toJson())
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
fun enrollmentCompletion(callback: Callback) = { livenessResponse: LivenessResponse, enrollmentResponse: EnrollmentResponse? ->
|
|
406
|
+
callback(mapOf(
|
|
407
|
+
"livenessResponse" to generateLivenessResponse(livenessResponse),
|
|
408
|
+
"enrollmentResponse" to generateEnrollmentResponse(enrollmentResponse),
|
|
409
|
+
).toJson())
|
|
410
|
+
}
|
|
411
411
|
|
|
412
412
|
fun <T> databaseItemCompletion(callback: Callback, toJson: ((T?) -> JSONObject?)?) = object : PersonDBCallback<T> {
|
|
413
413
|
override fun onSuccess(data: T?) = callback(generatePersonDBResponse(toJson?.let { it(data) } ?: true, null))
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"android": "scripts/android.sh"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@regulaforensics/face-sdk": "8.3.
|
|
10
|
-
"@regulaforensics/face-core-basic": "8.3.
|
|
9
|
+
"@regulaforensics/face-sdk": "8.3.1212-nightly",
|
|
10
|
+
"@regulaforensics/face-core-basic": "8.3.666-nightly",
|
|
11
11
|
"@awesome-cordova-plugins/file": "^8.1.0",
|
|
12
12
|
"@awesome-cordova-plugins/camera": "^8.1.0",
|
|
13
13
|
"cordova-plugin-file": "^8.1.3",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@awesome-cordova-plugins/camera": "^9.2.0",
|
|
21
21
|
"@awesome-cordova-plugins/dialogs": "^9.2.0",
|
|
22
22
|
"@awesome-cordova-plugins/file": "^9.2.0",
|
|
23
|
-
"@regulaforensics/face-sdk": "8.3.
|
|
24
|
-
"@regulaforensics/face-core-basic": "8.3.
|
|
23
|
+
"@regulaforensics/face-sdk": "8.3.1212-nightly",
|
|
24
|
+
"@regulaforensics/face-core-basic": "8.3.666-nightly",
|
|
25
25
|
"cordova-android": "^15.0.0",
|
|
26
26
|
"cordova-ios": "^8.1.1",
|
|
27
27
|
"cordova-plugin-camera": "^8.0.0",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"start": "expo start"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@regulaforensics/face-sdk": "8.3.
|
|
12
|
-
"@regulaforensics/face-core-basic": "8.3.
|
|
11
|
+
"@regulaforensics/face-sdk": "8.3.1212-nightly",
|
|
12
|
+
"@regulaforensics/face-core-basic": "8.3.666-nightly",
|
|
13
13
|
"react-native": "^0.81.4",
|
|
14
14
|
"react-native-fs": "^2.20.0",
|
|
15
15
|
"react-native-image-picker": "^8.2.1",
|
package/ios/Config.swift
CHANGED
|
@@ -107,111 +107,111 @@ public extension LivenessConfiguration {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
110
|
+
public extension EnrollmentConfiguration {
|
|
111
|
+
static func decode2(_ it: [String: Any]) -> Self {
|
|
112
|
+
return Self.init({ builder in
|
|
113
|
+
for (k, v) in it {
|
|
114
|
+
switch k {
|
|
115
|
+
case("copyright"): builder.isCopyright = v as! Bool
|
|
116
|
+
case("cameraSwitchEnabled"): builder.isCameraSwitchButtonEnabled = v as! Bool
|
|
117
|
+
case("closeButtonEnabled"): builder.isCloseButtonEnabled = v as! Bool
|
|
118
|
+
case("torchButtonEnabled"): builder.isTorchButtonEnabled = v as! Bool
|
|
119
|
+
case("vibrateOnSteps"): builder.vibrateOnSteps = v as! Bool
|
|
120
|
+
case("cameraPositionIOS"): builder.cameraPosition = CameraPosition(rawValue: v as! Int)!
|
|
121
|
+
case("attemptsCount"): builder.attemptsCount = v as! Int
|
|
122
|
+
case("locationTrackingEnabled"): builder.isLocationTrackingEnabled = v as! Bool
|
|
123
|
+
case("preventScreenRecording"): builder.isPreventScreenRecordingEnable = v as! Bool
|
|
124
|
+
case("recordingProcess"): builder.recordingProcess = RecordingProcess(rawValue: v as! Int)!
|
|
125
|
+
case("livenessType"): builder.livenessType = LivenessType(rawValue: v as! Int)!
|
|
126
|
+
case("screenOrientation"): builder.screenOrientation = RFSScreenOrientation.decode(v)
|
|
127
|
+
case("tag"): builder.tag = v as? String
|
|
128
|
+
case("externalId"): builder.externalId = v as! String
|
|
129
|
+
case("groupId"): builder.groupId = v as? String
|
|
130
|
+
case("checkDuplicatesEnabled"): builder.checkDuplicatesEnabled = v as? NSNumber
|
|
131
|
+
case("duplicatesThreshold"): builder.duplicatesThreshold = v as? NSNumber
|
|
132
|
+
case("skipStep"): builder.stepSkippingMask = RFSLivenessStepSkip.decode(v)
|
|
133
|
+
case("metadata"): builder.metadata = v as! [String: Any]
|
|
134
|
+
default: break
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
func encode2() -> [String: Any?] {
|
|
140
|
+
return [
|
|
141
|
+
"copyright": self.isCopyright,
|
|
142
|
+
"cameraSwitchEnabled": self.isCameraSwitchButtonEnabled,
|
|
143
|
+
"closeButtonEnabled": self.isCloseButtonEnabled,
|
|
144
|
+
"torchButtonEnabled": self.isTorchButtonEnabled,
|
|
145
|
+
"vibrateOnSteps": self.vibrateOnSteps,
|
|
146
|
+
"cameraPositionIOS": self.cameraPosition.rawValue,
|
|
147
|
+
"attemptsCount": self.attemptsCount,
|
|
148
|
+
"locationTrackingEnabled": self.isLocationTrackingEnabled,
|
|
149
|
+
"preventScreenRecording": self.isPreventScreenRecordingEnable,
|
|
150
|
+
"recordingProcess": self.recordingProcess.rawValue,
|
|
151
|
+
"livenessType": self.livenessType.rawValue,
|
|
152
|
+
"screenOrientation": self.screenOrientation.encode(),
|
|
153
|
+
"tag": self.tag,
|
|
154
|
+
"externalId": self.externalId,
|
|
155
|
+
"groupId": self.groupId,
|
|
156
|
+
"checkDuplicatesEnabled": self.checkDuplicatesEnabled,
|
|
157
|
+
"duplicatesThreshold": self.duplicatesThreshold,
|
|
158
|
+
"skipStep": self.stepSkippingMask.encode(),
|
|
159
|
+
"metadata": self.metadata,
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
public extension VerificationConfiguration {
|
|
165
|
+
static func decode2(_ it: [String: Any]) -> Self {
|
|
166
|
+
return Self.init({ builder in
|
|
167
|
+
for (k, v) in it {
|
|
168
|
+
switch k {
|
|
169
|
+
case("copyright"): builder.isCopyright = v as! Bool
|
|
170
|
+
case("cameraSwitchEnabled"): builder.isCameraSwitchButtonEnabled = v as! Bool
|
|
171
|
+
case("closeButtonEnabled"): builder.isCloseButtonEnabled = v as! Bool
|
|
172
|
+
case("torchButtonEnabled"): builder.isTorchButtonEnabled = v as! Bool
|
|
173
|
+
case("vibrateOnSteps"): builder.vibrateOnSteps = v as! Bool
|
|
174
|
+
case("cameraPositionIOS"): builder.cameraPosition = CameraPosition(rawValue: v as! Int)!
|
|
175
|
+
case("attemptsCount"): builder.attemptsCount = v as! Int
|
|
176
|
+
case("locationTrackingEnabled"): builder.isLocationTrackingEnabled = v as! Bool
|
|
177
|
+
case("preventScreenRecording"): builder.isPreventScreenRecordingEnable = v as! Bool
|
|
178
|
+
case("recordingProcess"): builder.recordingProcess = RecordingProcess(rawValue: v as! Int)!
|
|
179
|
+
case("livenessType"): builder.livenessType = LivenessType(rawValue: v as! Int)!
|
|
180
|
+
case("screenOrientation"): builder.screenOrientation = RFSScreenOrientation.decode(v)
|
|
181
|
+
case("tag"): builder.tag = v as? String
|
|
182
|
+
case("personId"): builder.personId = v as! String
|
|
183
|
+
case("groupId"): builder.groupId = v as? String
|
|
184
|
+
case("threshold"): builder.threshold = v as? NSNumber
|
|
185
|
+
case("skipStep"): builder.stepSkippingMask = RFSLivenessStepSkip.decode(v)
|
|
186
|
+
case("metadata"): builder.metadata = v as! [String: Any]
|
|
187
|
+
default: break
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
func encode2() -> [String: Any?] {
|
|
193
|
+
return [
|
|
194
|
+
"copyright": self.isCopyright,
|
|
195
|
+
"cameraSwitchEnabled": self.isCameraSwitchButtonEnabled,
|
|
196
|
+
"closeButtonEnabled": self.isCloseButtonEnabled,
|
|
197
|
+
"torchButtonEnabled": self.isTorchButtonEnabled,
|
|
198
|
+
"vibrateOnSteps": self.vibrateOnSteps,
|
|
199
|
+
"cameraPositionIOS": self.cameraPosition.rawValue,
|
|
200
|
+
"attemptsCount": self.attemptsCount,
|
|
201
|
+
"locationTrackingEnabled": self.isLocationTrackingEnabled,
|
|
202
|
+
"preventScreenRecording": self.isPreventScreenRecordingEnable,
|
|
203
|
+
"recordingProcess": self.recordingProcess.rawValue,
|
|
204
|
+
"livenessType": self.livenessType.rawValue,
|
|
205
|
+
"screenOrientation": self.screenOrientation.encode(),
|
|
206
|
+
"tag": self.tag,
|
|
207
|
+
"personId": self.personId,
|
|
208
|
+
"groupId": self.groupId,
|
|
209
|
+
"threshold": self.threshold,
|
|
210
|
+
"skipStep": self.stepSkippingMask.encode(),
|
|
211
|
+
"metadata": self.metadata,
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
215
|
|
|
216
216
|
public extension MatchFacesConfiguration {
|
|
217
217
|
static func decode(_ it: Any?) -> Self? {
|
package/ios/Decoder.swift
CHANGED
|
@@ -144,73 +144,73 @@ func generateLivenessNotification(_ status: LivenessProcessStatus, _ result: Liv
|
|
|
144
144
|
]
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
147
|
+
public extension ErrorResponse {
|
|
148
|
+
static func decode(_ it: Any?) -> ErrorResponse? {
|
|
149
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
150
|
+
let result = ErrorResponse.emptyInit() as ErrorResponse
|
|
151
|
+
result.setValue(it["code"] as Any?, forKey: "code")
|
|
152
|
+
result.setValue(it["message"] as Any?, forKey: "message")
|
|
153
|
+
return result
|
|
154
|
+
}
|
|
155
|
+
func encode() -> [String: Any?] {
|
|
156
|
+
return [
|
|
157
|
+
"code": self.code,
|
|
158
|
+
"message": self.message,
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public extension EnrollmentResponse {
|
|
164
|
+
static func decode(_ it: Any?) -> EnrollmentResponse? {
|
|
165
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
166
|
+
let result = EnrollmentResponse.emptyInit() as EnrollmentResponse
|
|
167
|
+
result.setValue(ErrorResponse.decode(it["error"]), forKey: "error")
|
|
168
|
+
result.setValue(it["personId"] as Any?, forKey: "personId")
|
|
169
|
+
result.setValue(it["externalId"] as Any?, forKey: "externalId")
|
|
170
|
+
return result
|
|
171
|
+
}
|
|
172
|
+
func encode() -> [String: Any?] {
|
|
173
|
+
return [
|
|
174
|
+
"error": self.error?.encode(),
|
|
175
|
+
"personId": self.personId,
|
|
176
|
+
"externalId": self.externalId,
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
public extension VerifyMatchResponse {
|
|
182
|
+
static func decode(_ it: Any?) -> VerifyMatchResponse? {
|
|
183
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
184
|
+
let result = VerifyMatchResponse.emptyInit() as VerifyMatchResponse
|
|
185
|
+
result.setValue(it["passed"] as Any?, forKey: "passed")
|
|
186
|
+
result.setValue(it["similarity"] as Any?, forKey: "similarity")
|
|
187
|
+
return result
|
|
188
|
+
}
|
|
189
|
+
func encode() -> [String: Any?] {
|
|
190
|
+
return [
|
|
191
|
+
"passed": self.passed,
|
|
192
|
+
"similarity": self.similarity,
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public extension VerificationResponse {
|
|
198
|
+
static func decode(_ it: Any?) -> VerificationResponse? {
|
|
199
|
+
guard let it = it as? [String: Any] else { return nil }
|
|
200
|
+
let result = VerificationResponse.emptyInit() as VerificationResponse
|
|
201
|
+
result.setValue(VerifyMatchResponse.decode(it["match"]), forKey: "match")
|
|
202
|
+
result.setValue(ErrorResponse.decode(it["error"]), forKey: "error")
|
|
203
|
+
result.setValue(it["passed"] as Any?, forKey: "passed")
|
|
204
|
+
return result
|
|
205
|
+
}
|
|
206
|
+
func encode() -> [String: Any?] {
|
|
207
|
+
return [
|
|
208
|
+
"match": self.match?.encode(),
|
|
209
|
+
"error": self.error?.encode(),
|
|
210
|
+
"passed": self.passed,
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
214
|
|
|
215
215
|
// MARK: - MatchFacesRequest
|
|
216
216
|
|
package/ios/Main.swift
CHANGED
|
@@ -55,28 +55,28 @@ func methodCall(_ method: String, _ callback: @escaping Callback) {
|
|
|
55
55
|
configuration: config,
|
|
56
56
|
onLiveness: { callback($0.encode()) })
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
case("startEnrollment"): let config = EnrollmentConfiguration.decode2(args(0))
|
|
59
|
+
DispatchQueue.main.async {
|
|
60
|
+
face.startEnrollment(
|
|
61
|
+
from: rootViewController()!,
|
|
62
|
+
animated: true,
|
|
63
|
+
configuration: config,
|
|
64
|
+
onEnrollment: { callback([
|
|
65
|
+
"livenessResponse": $0.encode(),
|
|
66
|
+
"enrollmentResponse": $1?.encode()
|
|
67
|
+
]) })
|
|
68
|
+
}
|
|
69
|
+
case("startVerification"): let config = VerificationConfiguration.decode2(args(0))
|
|
70
|
+
DispatchQueue.main.async {
|
|
71
|
+
face.startVerification(
|
|
72
|
+
from: rootViewController()!,
|
|
73
|
+
animated: true,
|
|
74
|
+
configuration: config,
|
|
75
|
+
onVerification: { callback([
|
|
76
|
+
"livenessResponse": $0.encode(),
|
|
77
|
+
"verificationResponse": $1?.encode()
|
|
78
|
+
]) })
|
|
79
|
+
}
|
|
80
80
|
case("stopLiveness"): face.stopLivenessProcessing()
|
|
81
81
|
case("matchFaces"): face.matchFaces(
|
|
82
82
|
MatchFacesRequest.decode(args(0)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/face-sdk",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.1212-nightly",
|
|
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="8.3.
|
|
2
|
+
<plugin id="@regulaforensics/face-sdk" version="8.3.1212-nightly" 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>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<source url="https://github.com/regulaforensics/podspecs.git" />
|
|
28
28
|
</config>
|
|
29
29
|
<pods>
|
|
30
|
-
<pod name="
|
|
30
|
+
<pod name="FaceSDKNightly" spec="8.3.4690" />
|
|
31
31
|
</pods>
|
|
32
32
|
</podspec>
|
|
33
33
|
</platform>
|
package/test/package-lock.json
CHANGED
|
@@ -13,12 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"..": {
|
|
15
15
|
"name": "@regulaforensics/face-sdk",
|
|
16
|
-
"version": "
|
|
16
|
+
"version": "1.0.0",
|
|
17
17
|
"dev": true,
|
|
18
|
-
"license": "commercial"
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@expo/config-plugins": "^10.0.0"
|
|
21
|
-
}
|
|
18
|
+
"license": "commercial"
|
|
22
19
|
},
|
|
23
20
|
"node_modules/@esbuild/aix-ppc64": {
|
|
24
21
|
"version": "0.25.9",
|
package/test/test.tsx
CHANGED
|
@@ -49,13 +49,13 @@ import {
|
|
|
49
49
|
SearchPersonImage,
|
|
50
50
|
SearchPersonRequest,
|
|
51
51
|
Size,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
EnrollmentConfig,
|
|
53
|
+
VerificationConfig,
|
|
54
|
+
EnrollmentRequest,
|
|
55
|
+
ErrorResponse,
|
|
56
|
+
EnrollmentResponse,
|
|
57
|
+
VerifyMatchResponse,
|
|
58
|
+
VerificationResponse,
|
|
59
59
|
} from '@regulaforensics/face-sdk/www/capacitor'
|
|
60
60
|
import {
|
|
61
61
|
comparedFace,
|
|
@@ -148,18 +148,18 @@ compare('faceCaptureException', faceCaptureException, FaceCaptureException.fromJ
|
|
|
148
148
|
compare('faceCaptureResponse', faceCaptureResponse, FaceCaptureResponse.fromJson);
|
|
149
149
|
|
|
150
150
|
compare('livenessConfig', livenessConfig, LivenessConfig.fromJson);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
compare('enrollmentConfig', enrollmentConfig, EnrollmentConfig.fromJson);
|
|
152
|
+
compare('verificationConfig', verificationConfig, VerificationConfig.fromJson);
|
|
153
|
+
compare('enrollmentRequest', enrollmentRequest, EnrollmentRequest.fromJson);
|
|
154
|
+
compare('enrollmentRequest2', enrollmentRequest2, EnrollmentRequest.fromJson);
|
|
155
155
|
compare('livenessBackendException', livenessBackendException, LivenessBackendException.fromJson);
|
|
156
156
|
compare('livenessException', livenessException, LivenessException.fromJson);
|
|
157
157
|
compare('livenessResponse', livenessResponse, LivenessResponse.fromJson);
|
|
158
158
|
compare('livenessNotification', livenessNotification, LivenessNotification.fromJson);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
compare('errorResponse', errorResponse, ErrorResponse.fromJson);
|
|
160
|
+
compare('enrollmentResponse', enrollmentResponse, EnrollmentResponse.fromJson);
|
|
161
|
+
compare('verifyMatchResponse', verifyMatchResponse, VerifyMatchResponse.fromJson);
|
|
162
|
+
compare('verificationResponse', verificationResponse, VerificationResponse.fromJson);
|
|
163
163
|
|
|
164
164
|
compare('matchFacesConfig', matchFacesConfig, MatchFacesConfig.fromJson);
|
|
165
165
|
compare('matchFacesImage', matchFacesImage, MatchFacesImage.fromJson);
|
package/www/types/index.d.ts
CHANGED
|
@@ -122,13 +122,13 @@ export {
|
|
|
122
122
|
LivenessNotificationCompletion,
|
|
123
123
|
LivenessResponse,
|
|
124
124
|
LivenessStatus,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
EnrollmentConfig,
|
|
126
|
+
EnrollmentRequest,
|
|
127
|
+
VerificationConfig,
|
|
128
|
+
ErrorResponse,
|
|
129
|
+
EnrollmentResponse,
|
|
130
|
+
VerifyMatchResponse,
|
|
131
|
+
VerificationResponse,
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
import { ComparedFace } from './match_faces/compared_face'
|
|
@@ -283,23 +283,23 @@ export class FaceSDK {
|
|
|
283
283
|
}
|
|
284
284
|
): Promise<LivenessResponse>
|
|
285
285
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
286
|
+
startEnrollment(
|
|
287
|
+
config: EnrollmentConfig,
|
|
288
|
+
options?: {
|
|
289
|
+
notificationCompletion?: LivenessNotificationCompletion,
|
|
290
|
+
cameraSwitchCallback?: CameraSwitchCallback,
|
|
291
|
+
}
|
|
292
|
+
): Promise<[LivenessResponse, EnrollmentResponse | null]>
|
|
293
|
+
|
|
294
|
+
startVerification(
|
|
295
|
+
config: VerificationConfig,
|
|
296
|
+
options?: {
|
|
297
|
+
notificationCompletion?: LivenessNotificationCompletion,
|
|
298
|
+
cameraSwitchCallback?: CameraSwitchCallback,
|
|
299
|
+
}
|
|
300
|
+
): Promise<[LivenessResponse, VerificationResponse | null]>
|
|
301
|
+
|
|
302
|
+
enrollWithTrustedPhoto(request: EnrollmentRequest): Promise<EnrollmentResponse>
|
|
303
303
|
|
|
304
304
|
stopLiveness(): void
|
|
305
305
|
|