@regulaforensics/face-sdk 7.2.422-beta → 7.2.425-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/README.md +2 -3
- package/RNFaceSDK.podspec +1 -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 +18 -0
- package/examples/capacitor/android/app/src/main/AndroidManifest.xml +2 -2
- package/examples/capacitor/index.html +2 -7
- package/examples/capacitor/index.tsx +53 -0
- package/examples/capacitor/package-lock.json +17 -3
- package/examples/capacitor/package.json +2 -2
- package/examples/capacitor/scripts/setup.sh +4 -2
- package/examples/capacitor/src/main.css +60 -6
- package/examples/capacitor/src/main.html +1 -1
- package/examples/capacitor/src/main.tsx +51 -87
- package/examples/ionic/README.md +1 -1
- package/examples/ionic/angular.json +3 -3
- package/examples/ionic/config.xml +4 -2
- package/examples/ionic/index.tsx +68 -0
- package/examples/ionic/package-lock.json +849 -763
- package/examples/ionic/package.json +2 -2
- package/examples/ionic/src/main.css +60 -6
- package/examples/ionic/src/main.html +1 -1
- package/examples/ionic/src/{main.ts → main.tsx} +52 -97
- package/examples/ionic/tsconfig.json +3 -2
- package/examples/react_native/README.md +1 -0
- package/examples/react_native/app.config.ts +1 -1
- package/examples/react_native/index.tsx +49 -7
- package/examples/react_native/package-lock.json +618 -621
- package/examples/react_native/package.json +8 -8
- package/examples/react_native/src/main.css +60 -6
- package/examples/react_native/src/main.html +1 -1
- package/examples/react_native/src/main.tsx +54 -79
- package/ios/RFSWJSONConstructor.h +0 -1
- package/ios/RFSWJSONConstructor.m +5 -14
- package/ios/RFSWMain.m +30 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/test/json.tsx +375 -0
- package/test/package-lock.json +584 -0
- package/test/package.json +9 -0
- package/test/test.tsx +61 -0
- package/test/utils.tsx +38 -0
- package/www/capacitor/customization/customization_fonts.js +1 -1
- package/www/capacitor/customization/customization_images.js +1 -1
- package/www/capacitor/customization/font.js +8 -0
- package/www/capacitor/detect_faces/detect_face_result.js +12 -0
- package/www/capacitor/detect_faces/detect_faces_attribute_result.js +9 -0
- package/www/capacitor/detect_faces/detect_faces_backend_exception.js +7 -0
- package/www/capacitor/detect_faces/detect_faces_config.js +34 -0
- package/www/capacitor/detect_faces/detect_faces_exception.js +8 -0
- package/www/capacitor/detect_faces/detect_faces_request.js +22 -0
- package/www/capacitor/detect_faces/detect_faces_response.js +9 -0
- package/www/capacitor/face_capture/face_capture_config.js +37 -0
- package/www/capacitor/face_capture/face_capture_exception.js +7 -0
- package/www/capacitor/face_capture/face_capture_image.js +8 -0
- package/www/capacitor/face_capture/face_capture_response.js +7 -0
- package/www/capacitor/image_params/output_image_crop.js +23 -0
- package/www/capacitor/image_params/output_image_params.js +19 -0
- package/www/capacitor/image_params/point.js +7 -0
- package/www/capacitor/image_params/rect.js +9 -0
- package/www/capacitor/image_params/size.js +12 -0
- package/www/capacitor/image_quality/image_quality_characteristic.js +22 -0
- package/www/capacitor/image_quality/image_quality_range.js +7 -0
- package/www/capacitor/image_quality/image_quality_result.js +10 -0
- package/www/capacitor/index.js +48 -0
- package/www/capacitor/init/face_sdk_version.js +8 -0
- package/www/capacitor/init/init_config.js +19 -0
- package/www/capacitor/init/init_exception.js +8 -0
- package/www/capacitor/init/license_exception.js +7 -0
- package/www/capacitor/internal/bridge.js +20 -1
- package/www/capacitor/liveness/liveness_backend_exception.js +7 -0
- package/www/capacitor/liveness/liveness_config.js +43 -0
- package/www/capacitor/liveness/liveness_exception.js +8 -0
- package/www/capacitor/liveness/liveness_notification.js +7 -0
- package/www/capacitor/liveness/liveness_response.js +11 -0
- package/www/capacitor/match_faces/compared_face.js +9 -0
- package/www/capacitor/match_faces/compared_faces_pair.js +10 -0
- package/www/capacitor/match_faces/compared_faces_split.js +7 -0
- package/www/capacitor/match_faces/match_faces_backend_exception.js +7 -0
- package/www/capacitor/match_faces/match_faces_config.js +19 -0
- package/www/capacitor/match_faces/match_faces_detection.js +9 -0
- package/www/capacitor/match_faces/match_faces_detection_face.js +11 -0
- package/www/capacitor/match_faces/match_faces_exception.js +8 -0
- package/www/capacitor/match_faces/match_faces_image.js +9 -0
- package/www/capacitor/match_faces/match_faces_request.js +27 -0
- package/www/capacitor/match_faces/match_faces_response.js +9 -0
- package/www/capacitor/person_database/edit_group_persons_request.js +15 -0
- package/www/capacitor/person_database/image_upload.js +17 -0
- package/www/capacitor/person_database/pageable_item_list.js +8 -0
- package/www/capacitor/person_database/person.js +13 -0
- package/www/capacitor/person_database/person_group.js +11 -0
- package/www/capacitor/person_database/person_image.js +13 -0
- package/www/capacitor/person_database/search_person.js +14 -0
- package/www/capacitor/person_database/search_person_detection.js +9 -0
- package/www/capacitor/person_database/search_person_image.js +15 -0
- package/www/capacitor/person_database/search_person_request.js +29 -0
- package/www/cordova.js +753 -6
- package/www/react-native/customization/customization_fonts.js +1 -1
- package/www/react-native/customization/customization_images.js +1 -1
- package/www/react-native/customization/font.js +8 -0
- package/www/react-native/detect_faces/detect_face_result.js +12 -0
- package/www/react-native/detect_faces/detect_faces_attribute_result.js +9 -0
- package/www/react-native/detect_faces/detect_faces_backend_exception.js +7 -0
- package/www/react-native/detect_faces/detect_faces_config.js +34 -0
- package/www/react-native/detect_faces/detect_faces_exception.js +8 -0
- package/www/react-native/detect_faces/detect_faces_request.js +22 -0
- package/www/react-native/detect_faces/detect_faces_response.js +9 -0
- package/www/react-native/face_capture/face_capture_config.js +37 -0
- package/www/react-native/face_capture/face_capture_exception.js +7 -0
- package/www/react-native/face_capture/face_capture_image.js +8 -0
- package/www/react-native/face_capture/face_capture_response.js +7 -0
- package/www/react-native/image_params/output_image_crop.js +23 -0
- package/www/react-native/image_params/output_image_params.js +19 -0
- package/www/react-native/image_params/point.js +7 -0
- package/www/react-native/image_params/rect.js +9 -0
- package/www/react-native/image_params/size.js +12 -0
- package/www/react-native/image_quality/image_quality_characteristic.js +22 -0
- package/www/react-native/image_quality/image_quality_range.js +7 -0
- package/www/react-native/image_quality/image_quality_result.js +10 -0
- package/www/react-native/index.js +48 -0
- package/www/react-native/init/face_sdk_version.js +8 -0
- package/www/react-native/init/init_config.js +19 -0
- package/www/react-native/init/init_exception.js +8 -0
- package/www/react-native/init/license_exception.js +7 -0
- package/www/react-native/internal/bridge.js +20 -1
- package/www/react-native/liveness/liveness_backend_exception.js +7 -0
- package/www/react-native/liveness/liveness_config.js +43 -0
- package/www/react-native/liveness/liveness_exception.js +8 -0
- package/www/react-native/liveness/liveness_notification.js +7 -0
- package/www/react-native/liveness/liveness_response.js +11 -0
- package/www/react-native/match_faces/compared_face.js +9 -0
- package/www/react-native/match_faces/compared_faces_pair.js +10 -0
- package/www/react-native/match_faces/compared_faces_split.js +7 -0
- package/www/react-native/match_faces/match_faces_backend_exception.js +7 -0
- package/www/react-native/match_faces/match_faces_config.js +19 -0
- package/www/react-native/match_faces/match_faces_detection.js +9 -0
- package/www/react-native/match_faces/match_faces_detection_face.js +11 -0
- package/www/react-native/match_faces/match_faces_exception.js +8 -0
- package/www/react-native/match_faces/match_faces_image.js +9 -0
- package/www/react-native/match_faces/match_faces_request.js +27 -0
- package/www/react-native/match_faces/match_faces_response.js +9 -0
- package/www/react-native/person_database/edit_group_persons_request.js +15 -0
- package/www/react-native/person_database/image_upload.js +17 -0
- package/www/react-native/person_database/pageable_item_list.js +8 -0
- package/www/react-native/person_database/person.js +13 -0
- package/www/react-native/person_database/person_group.js +11 -0
- package/www/react-native/person_database/person_image.js +13 -0
- package/www/react-native/person_database/search_person.js +14 -0
- package/www/react-native/person_database/search_person_detection.js +9 -0
- package/www/react-native/person_database/search_person_image.js +15 -0
- package/www/react-native/person_database/search_person_request.js +29 -0
- package/www/types/index.d.ts +12 -0
- package/www/types/match_faces/match_faces_config.d.ts +2 -0
- package/www/types/person_database/search_person_request.d.ts +4 -0
- package/examples/cordova/.vscode/launch.json +0 -28
- package/examples/cordova/README.md +0 -25
- package/examples/cordova/config.xml +0 -26
- package/examples/cordova/package-lock.json +0 -1313
- package/examples/cordova/package.json +0 -30
- package/examples/cordova/scripts/android.sh +0 -8
- package/examples/cordova/scripts/ios.sh +0 -8
- package/examples/cordova/scripts/setup.sh +0 -8
- package/examples/cordova/www/images/logo.png +0 -0
- package/examples/cordova/www/index.html +0 -21
- package/examples/cordova/www/src/main.css +0 -83
- package/examples/cordova/www/src/main.html +0 -25
- package/examples/cordova/www/src/main.js +0 -152
- package/examples/ionic/index.ts +0 -17
- package/examples/ionic/src/images/portrait.png +0 -0
- /package/examples/ionic/{src/assets → assets}/.gitkeep +0 -0
- /package/examples/ionic/{src/images → images}/icon.png +0 -0
- /package/examples/{cordova/www → ionic}/images/portrait.png +0 -0
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
"start": "expo start"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@regulaforensics/face-sdk": "7.2.
|
|
11
|
+
"@regulaforensics/face-sdk": "7.2.425-beta",
|
|
12
12
|
"@regulaforensics/face-core-basic": "7.1.202",
|
|
13
|
-
"react-native": "0.79.
|
|
13
|
+
"react-native": "0.79.5",
|
|
14
14
|
"react-native-fs": "2.20.0",
|
|
15
15
|
"react-native-image-picker": "8.2.1",
|
|
16
|
-
"react-native-webview": "13.
|
|
17
|
-
"@react-native/metro-config": "0.79.
|
|
16
|
+
"react-native-webview": "13.15.0",
|
|
17
|
+
"@react-native/metro-config": "0.79.5",
|
|
18
18
|
"react": "19.1.0",
|
|
19
|
-
"@types/react": "19.1.
|
|
20
|
-
"expo": "53.0.
|
|
21
|
-
"expo-dev-client": "5.
|
|
19
|
+
"@types/react": "19.1.8",
|
|
20
|
+
"expo": "53.0.20",
|
|
21
|
+
"expo-dev-client": "5.2.4",
|
|
22
22
|
"expo-custom-assets": "1.4.1",
|
|
23
|
-
"expo-build-properties": "0.14.
|
|
23
|
+
"expo-build-properties": "0.14.8",
|
|
24
24
|
"typescript": "5.8.3"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
html,
|
|
2
2
|
body {
|
|
3
|
-
|
|
3
|
+
margin: 0;
|
|
4
|
+
width: 100%;
|
|
4
5
|
height: 99vh;
|
|
5
6
|
display: flex;
|
|
7
|
+
overflow: hidden;
|
|
6
8
|
flex-direction: column;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/* Prevent text selection */
|
|
12
|
+
* {
|
|
13
|
+
user-select: none !important;
|
|
14
|
+
-webkit-user-select: none !important;
|
|
15
|
+
-webkit-user-drag: none !important;
|
|
16
|
+
-webkit-touch-callout: none !important;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
.column {
|
|
@@ -52,10 +56,14 @@ body {
|
|
|
52
56
|
margin-top: 13px;
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
.scroll {
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
.no-scroll {
|
|
56
65
|
flex-grow: 1;
|
|
57
66
|
overflow-y: hidden;
|
|
58
|
-
overflow-x: hidden;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
.button {
|
|
@@ -67,6 +75,7 @@ body {
|
|
|
67
75
|
color: white;
|
|
68
76
|
border: none;
|
|
69
77
|
padding: 10px 20px;
|
|
78
|
+
justify-content: center;
|
|
70
79
|
font-size: 16px;
|
|
71
80
|
border-radius: 100px;
|
|
72
81
|
cursor: pointer;
|
|
@@ -80,4 +89,49 @@ body {
|
|
|
80
89
|
.button:active {
|
|
81
90
|
position: relative;
|
|
82
91
|
top: 1px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.text-button {
|
|
95
|
+
background: none;
|
|
96
|
+
border: none;
|
|
97
|
+
color: #2196f3;
|
|
98
|
+
font-size: 20px;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
padding: 5px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.text-button:active {
|
|
104
|
+
position: relative;
|
|
105
|
+
top: 1px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.radio {
|
|
109
|
+
align-items: baseline;
|
|
110
|
+
padding: 15px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
input[type="checkbox"] {
|
|
114
|
+
width: 20px;
|
|
115
|
+
height: 20px;
|
|
116
|
+
border: 2px solid black;
|
|
117
|
+
background-color: white;
|
|
118
|
+
display: inline-block;
|
|
119
|
+
position: relative;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.progress-bar {
|
|
124
|
+
width: 75%;
|
|
125
|
+
padding: 3px;
|
|
126
|
+
margin-top: 40px;
|
|
127
|
+
background-color: #eee;
|
|
128
|
+
border-radius: 8px;
|
|
129
|
+
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#progress {
|
|
133
|
+
width: 0%;
|
|
134
|
+
height: 20px;
|
|
135
|
+
background-color: #4285F4;
|
|
136
|
+
border-radius: 5px;
|
|
83
137
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { document } from '../index'
|
|
2
|
-
import * as RNFS from 'react-native-fs'
|
|
3
|
-
import { Alert, Platform } from 'react-native'
|
|
4
|
-
import { launchImageLibrary } from 'react-native-image-picker'
|
|
5
1
|
import { FaceSDK, MatchFacesRequest, MatchFacesImage, InitConfig, LivenessSkipStep, ImageType, LivenessStatus, LivenessConfig } from '@regulaforensics/face-sdk'
|
|
2
|
+
import { loadAssetIfExists, chooseOption, pickImage } from '../index'
|
|
3
|
+
|
|
4
|
+
var faceSdk = FaceSDK.instance
|
|
5
|
+
var image1: MatchFacesImage | null
|
|
6
|
+
var image2: MatchFacesImage | null
|
|
6
7
|
|
|
7
8
|
async function init() {
|
|
8
|
-
if (!await
|
|
9
|
+
if (!await initializeReader()) return
|
|
9
10
|
setStatus("Ready")
|
|
10
|
-
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function startFaceCapture(position: number) {
|
|
14
|
+
var image = (await faceSdk.startFaceCapture()).image
|
|
15
|
+
if (image == null) return
|
|
16
|
+
setImage("data:image/png;base64," + image.image, image.imageType, position)
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
async function startLiveness() {
|
|
@@ -19,9 +25,8 @@ async function startLiveness() {
|
|
|
19
25
|
console.log("LivenessStatus: " + notification.status)
|
|
20
26
|
}
|
|
21
27
|
})
|
|
22
|
-
console.log("response", { ...response, image: null })
|
|
23
28
|
if (response.image == null) return
|
|
24
|
-
setImage(response.image, ImageType.LIVE, 1)
|
|
29
|
+
setImage("data:image/png;base64," + response.image, ImageType.LIVE, 1)
|
|
25
30
|
setLivenessStatus(response.liveness == LivenessStatus.PASSED ? "passed" : "unknown")
|
|
26
31
|
}
|
|
27
32
|
|
|
@@ -41,18 +46,34 @@ async function matchFaces() {
|
|
|
41
46
|
setStatus("Ready")
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
function
|
|
45
|
-
|
|
49
|
+
async function getImage(position: number) {
|
|
50
|
+
var source = await chooseOption()
|
|
51
|
+
if (source == null) return
|
|
52
|
+
if (source) startFaceCapture(position)
|
|
53
|
+
else {
|
|
54
|
+
var image = await pickImage()
|
|
55
|
+
if (image == null) return
|
|
56
|
+
setImage(image, ImageType.PRINTED, position)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setImage(base64: string, type: number, position: number) {
|
|
46
61
|
setSimilarityStatus("null")
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
var mfImage = new MatchFacesImage(base64, type)
|
|
63
|
+
if (position == 1) {
|
|
64
|
+
image1 = mfImage
|
|
65
|
+
setUiImage1(base64)
|
|
66
|
+
setLivenessStatus("null")
|
|
67
|
+
}
|
|
68
|
+
if (position == 2) {
|
|
69
|
+
image2 = mfImage
|
|
70
|
+
setUiImage2(base64)
|
|
71
|
+
}
|
|
51
72
|
}
|
|
52
73
|
|
|
53
74
|
// If 'regula.license' exists, init using license(enables offline match)
|
|
54
75
|
// otherwise init without license.
|
|
55
|
-
async function
|
|
76
|
+
async function initializeReader() {
|
|
56
77
|
setStatus("Initializing...")
|
|
57
78
|
|
|
58
79
|
var license = await loadAssetIfExists("regula.license")
|
|
@@ -60,82 +81,36 @@ async function initialize() {
|
|
|
60
81
|
if (license != null) config = new InitConfig(license)
|
|
61
82
|
var [success, error] = await faceSdk.initialize({ config: config })
|
|
62
83
|
|
|
63
|
-
if (
|
|
84
|
+
if (error != null) {
|
|
64
85
|
setStatus(error.message)
|
|
65
86
|
console.log(error.code + ": " + error.message)
|
|
66
87
|
}
|
|
67
88
|
return success
|
|
68
89
|
}
|
|
69
90
|
|
|
70
|
-
|
|
71
|
-
setSimilarityStatus("null")
|
|
72
|
-
var mfImage = new MatchFacesImage(base64, type)
|
|
73
|
-
if (position == 1) {
|
|
74
|
-
image1 = mfImage
|
|
75
|
-
setUiImage1("data:image/png;base64," + base64)
|
|
76
|
-
setLivenessStatus("null")
|
|
77
|
-
}
|
|
78
|
-
if (position == 2) {
|
|
79
|
-
image2 = mfImage
|
|
80
|
-
setUiImage2("data:image/png;base64," + base64)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async function useCamera(position: number) {
|
|
85
|
-
var response = await faceSdk.startFaceCapture()
|
|
86
|
-
if (response.image == null) return
|
|
87
|
-
var image = response.image
|
|
88
|
-
setImage(image.image, image.imageType, position)
|
|
89
|
-
}
|
|
91
|
+
// --------------------------------------------------------------------------------------------------------------------
|
|
90
92
|
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (response.assets == null) return
|
|
98
|
-
setImage(response.assets[0].base64!, ImageType.PRINTED, position)
|
|
99
|
-
})
|
|
100
|
-
}
|
|
93
|
+
export function main() {
|
|
94
|
+
document.getElementById("first-image")!.onclick = () => getImage(1)
|
|
95
|
+
document.getElementById("second-image")!.onclick = () => getImage(2)
|
|
96
|
+
document.getElementById("match-faces")!.onclick = () => matchFaces()
|
|
97
|
+
document.getElementById("start-liveness")!.onclick = () => startLiveness()
|
|
98
|
+
document.getElementById("clear-results")!.onclick = () => clearResults()
|
|
101
99
|
|
|
102
|
-
|
|
103
|
-
Alert.alert("Select option", "", [
|
|
104
|
-
{ text: "Use gallery", onPress: () => useGallery(position) },
|
|
105
|
-
{ text: "Use camera", onPress: () => useCamera(position) }
|
|
106
|
-
], { cancelable: true })
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
110
|
-
if (Platform.OS === 'ios') path = RNFS.MainBundlePath + "/" + path
|
|
111
|
-
var readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileRes
|
|
112
|
-
try {
|
|
113
|
-
return await readFile(path, 'base64')
|
|
114
|
-
} catch {
|
|
115
|
-
return null
|
|
116
|
-
}
|
|
100
|
+
init()
|
|
117
101
|
}
|
|
118
102
|
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
var setStatus = (data: string) => document.getElementById("status").innerHTML = data
|
|
124
|
-
var setLivenessStatus = (data: string) => document.getElementById("liveness-status").innerHTML = data
|
|
125
|
-
var setSimilarityStatus = (data: string) => document.getElementById("similarity-status").innerHTML = data
|
|
103
|
+
var setStatus = (data: string) => document.getElementById("status")!.innerHTML = data
|
|
104
|
+
var setLivenessStatus = (data: string) => document.getElementById("liveness-status")!.innerHTML = data
|
|
105
|
+
var setSimilarityStatus = (data: string) => document.getElementById("similarity-status")!.innerHTML = data
|
|
126
106
|
var setUiImage1 = (data: string) => (document.getElementById("first-image") as HTMLImageElement).src = data
|
|
127
107
|
var setUiImage2 = (data: string) => (document.getElementById("second-image") as HTMLImageElement).src = data
|
|
128
|
-
var
|
|
108
|
+
var clearResults = () => {
|
|
109
|
+
setStatus("Ready")
|
|
110
|
+
setSimilarityStatus("null")
|
|
111
|
+
setLivenessStatus("null")
|
|
129
112
|
setUiImage1("images/portrait.png")
|
|
130
113
|
setUiImage2("images/portrait.png")
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
export function onload() {
|
|
134
|
-
document.getElementById("first-image").onclick = () => pickImage(1)
|
|
135
|
-
document.getElementById("second-image").onclick = () => pickImage(2)
|
|
136
|
-
document.getElementById("match-faces").onclick = () => matchFaces()
|
|
137
|
-
document.getElementById("start-liveness").onclick = () => startLiveness()
|
|
138
|
-
document.getElementById("clear-results").onclick = () => clearResults()
|
|
139
|
-
|
|
140
|
-
init()
|
|
114
|
+
image1 = null
|
|
115
|
+
image2 = null
|
|
141
116
|
}
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
+(RFSImageQualityCharacteristic* _Nonnull)imageQualityCharacteristicFromJSON:(id _Nonnull)input;
|
|
53
53
|
+(NSDictionary<NSString*, id>* _Nonnull)generateImageQualityCharacteristic:(RFSImageQualityCharacteristic* _Nonnull)input;
|
|
54
54
|
|
|
55
|
-
+(RFSFaceSDKVersion* _Nonnull)faceSDKVersionFromJSON:(id _Nonnull)input;
|
|
56
55
|
+(NSDictionary<NSString*, id>* _Nonnull)generateFaceSDKVersion:(RFSFaceSDKVersion* _Nonnull)input;
|
|
57
56
|
|
|
58
57
|
+(RFSInitializationConfiguration* _Nonnull)initConfigFromJSON:(id _Nonnull)input;
|
|
@@ -203,17 +203,7 @@
|
|
|
203
203
|
return result;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
if (!input || [input isEqual:[NSNull null]]) return nil;
|
|
208
|
-
RFSFaceSDKVersion* result = [RFSFaceSDKVersion new];
|
|
209
|
-
|
|
210
|
-
[result setValue:input[@"api"] forKey:@"api"];
|
|
211
|
-
[result setValue:input[@"core"] forKey:@"core"];
|
|
212
|
-
[result setValue:input[@"coreMode"] forKey:@"coreMode"];
|
|
213
|
-
|
|
214
|
-
return result;
|
|
215
|
-
}
|
|
216
|
-
|
|
206
|
+
// No fromJSON and no tests for FaceSDKVersion because of its implementation.
|
|
217
207
|
+(id)generateFaceSDKVersion:(RFSFaceSDKVersion*)input {
|
|
218
208
|
if (!input) return [NSNull null];
|
|
219
209
|
NSMutableDictionary* result = @{}.mutableCopy;
|
|
@@ -291,9 +281,9 @@
|
|
|
291
281
|
|
|
292
282
|
+(id)livenessResponseFromJSON:(NSDictionary*)input {
|
|
293
283
|
RFSLivenessResponse* result = [RFSLivenessResponse alloc];
|
|
294
|
-
SEL sel = NSSelectorFromString(@"initWithTag:transactionId:estimatedAge:status:
|
|
284
|
+
SEL sel = NSSelectorFromString(@"initWithTag:transactionId:estimatedAge:status:image:error:");
|
|
295
285
|
IMP imp = [result methodForSelector:sel];
|
|
296
|
-
void (*func)(id, SEL, id, id, id, NSInteger, id, id
|
|
286
|
+
void (*func)(id, SEL, id, id, id, NSInteger, id, id) = (void *)imp;
|
|
297
287
|
func(result,
|
|
298
288
|
sel,
|
|
299
289
|
input[@"tag"],
|
|
@@ -301,7 +291,6 @@
|
|
|
301
291
|
input[@"estimatedAge"],
|
|
302
292
|
[input[@"liveness"] integerValue],
|
|
303
293
|
[self imageWithBase64:input[@"image"]],
|
|
304
|
-
[self imageWithBase64:input[@"image"]],
|
|
305
294
|
nil);
|
|
306
295
|
return result;
|
|
307
296
|
}
|
|
@@ -893,6 +882,7 @@
|
|
|
893
882
|
imageUpload:[self imageUploadFromJSON:input[@"imageUpload"]]];
|
|
894
883
|
result.threshold = input[@"threshold"];
|
|
895
884
|
result.limit = input[@"limit"];
|
|
885
|
+
result.tag = input[@"tag"];
|
|
896
886
|
if (input[@"detectAll"] && ![input[@"detectAll"] isEqual:[NSNull null]]) result.detectAll = [input[@"detectAll"] boolValue];
|
|
897
887
|
result.outputImageParams = [self outputImageParamsFromJSON:input[@"outputImageParams"]];
|
|
898
888
|
return result;
|
|
@@ -906,6 +896,7 @@
|
|
|
906
896
|
}.mutableCopy;
|
|
907
897
|
if (input.threshold) result[@"threshold"] = input.threshold;
|
|
908
898
|
if (input.limit) result[@"limit"] = input.limit;
|
|
899
|
+
if (input.tag) result[@"tag"] = input.tag;
|
|
909
900
|
if (input.groupIdsForSearch) result[@"groupIdsForSearch"] = input.groupIdsForSearch;
|
|
910
901
|
if (input.outputImageParams) result[@"outputImageParams"] = [self generateOutputImageParams:input.outputImageParams];
|
|
911
902
|
return result;
|
package/ios/RFSWMain.m
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
@"getVersion": ^{ [self getVersion :callback]; },
|
|
10
10
|
@"getServiceUrl": ^{ [self getServiceUrl :callback]; },
|
|
11
11
|
@"setServiceUrl": ^{ [self setServiceUrl :args[0] :callback]; },
|
|
12
|
+
@"getTenant": ^{ [self getTenant :callback]; },
|
|
13
|
+
@"setTenant": ^{ [self setTenant :args[0]]; },
|
|
14
|
+
@"getEnv": ^{ [self getEnv :callback]; },
|
|
15
|
+
@"setEnv": ^{ [self setEnv :args[0]]; },
|
|
16
|
+
@"getLocale": ^{ [self getLocale :callback]; },
|
|
17
|
+
@"setLocale": ^{ [self setLocale :args[0]]; },
|
|
12
18
|
@"setLocalizationDictionary": ^{ [self setLocalizationDictionary :args[0]]; },
|
|
13
19
|
@"setRequestHeaders": ^{ [self setRequestHeaders :args[0]]; },
|
|
14
20
|
@"setCustomization": ^{ [self setCustomization :args[0]]; },
|
|
@@ -64,6 +70,30 @@ static NSDictionary* headers;
|
|
|
64
70
|
callback(@"");
|
|
65
71
|
}
|
|
66
72
|
|
|
73
|
+
+(void)getTenant:(RFSWCallback)callback {
|
|
74
|
+
callback([RFSFaceSDK.service tenant]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
+(void)setTenant:(NSString*)tag {
|
|
78
|
+
[RFSFaceSDK.service setTenant:tag];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
+(void)getEnv:(RFSWCallback)callback {
|
|
82
|
+
callback([RFSFaceSDK.service env]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
+(void)setEnv:(NSString*)tag {
|
|
86
|
+
[RFSFaceSDK.service setEnv:tag];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
+(void)getLocale:(RFSWCallback)callback {
|
|
90
|
+
callback([RFSFaceSDK.service languageLocaleCode]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
+(void)setLocale:(NSString*)locale {
|
|
94
|
+
[RFSFaceSDK.service setLanguageLocaleCode:locale];
|
|
95
|
+
}
|
|
96
|
+
|
|
67
97
|
+(void)setLocalizationDictionary:(NSDictionary*)dictionary {
|
|
68
98
|
RFSFaceSDK.service.localizationHandler = ^NSString* (NSString* localizationKey) {
|
|
69
99
|
if (dictionary[localizationKey]) return dictionary[localizationKey];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/face-sdk",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.425-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="7.2.
|
|
2
|
+
<plugin id="@regulaforensics/face-sdk" version="7.2.425-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>
|