@regulaforensics/face-sdk 8.5.1514-nightly → 8.5.1516-rc
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/Package.swift +1 -1
- package/android/build.gradle.kts +1 -1
- package/android/cordova.gradle.kts +1 -1
- package/examples/capacitor/package-lock.json +555 -0
- package/examples/capacitor/package.json +2 -2
- package/examples/ionic/README.md +2 -2
- package/examples/ionic/package-lock.json +489 -4398
- package/examples/ionic/package.json +3 -6
- package/examples/ionic/scripts/ios.sh +1 -3
- package/examples/react_native/README.md +2 -1
- package/examples/react_native/app.config.ts +0 -3
- package/examples/react_native/index.html +12 -0
- package/examples/react_native/index.tsx +35 -65
- package/examples/react_native/metro.config.js +3 -1
- package/examples/react_native/package-lock.json +1166 -1165
- package/examples/react_native/package.json +22 -13
- package/examples/react_native/scripts/android.sh +8 -1
- package/examples/react_native/scripts/ios.sh +11 -3
- package/examples/react_native/scripts/setup.sh +5 -1
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/react-native-face-sdk.podspec +2 -2
- package/test/package-lock.json +5 -2
- package/examples/react_native/scripts/withoutMetroServer.js +0 -86
|
@@ -15,22 +15,19 @@
|
|
|
15
15
|
"@angular/forms": "^22.1.7",
|
|
16
16
|
"@angular/platform-browser-dynamic": "^22.1.7",
|
|
17
17
|
"@angular/router": "^22.1.7",
|
|
18
|
-
"@ionic/cli": "^7.2.1",
|
|
19
18
|
"@ionic/angular": "^9.0.4",
|
|
20
19
|
"@ionic/cordova-builders": "^13.0.0",
|
|
21
20
|
"@awesome-cordova-plugins/camera": "^9.6.0",
|
|
22
21
|
"@awesome-cordova-plugins/dialogs": "^9.6.0",
|
|
23
22
|
"@awesome-cordova-plugins/file": "^9.6.0",
|
|
24
|
-
"@regulaforensics/face-sdk": "8.5.
|
|
25
|
-
"@regulaforensics/face-core-basic": "8.5.
|
|
26
|
-
"cordova": "^13.0.0",
|
|
23
|
+
"@regulaforensics/face-sdk": "8.5.1516-rc",
|
|
24
|
+
"@regulaforensics/face-core-basic": "8.5.909-rc",
|
|
27
25
|
"cordova-android": "^15.1.0",
|
|
28
26
|
"cordova-ios": "^8.1.1",
|
|
29
27
|
"cordova-plugin-camera": "^8.0.0",
|
|
30
28
|
"cordova-plugin-dialogs": "^2.0.2",
|
|
31
29
|
"cordova-plugin-file": "^8.1.3",
|
|
32
30
|
"cordova-plugin-ionic-webview": "^5.0.1",
|
|
33
|
-
"native-run": "^2.0.3",
|
|
34
31
|
"patch-package": "^8.0.1",
|
|
35
32
|
"@angular/compiler": "^22.1.7",
|
|
36
33
|
"@angular/platform-browser": "^22.1.7",
|
|
@@ -38,7 +35,7 @@
|
|
|
38
35
|
"typescript": "~6.0.3"
|
|
39
36
|
},
|
|
40
37
|
"overrides": {
|
|
41
|
-
"serialize-javascript": "^7.1.
|
|
38
|
+
"serialize-javascript": "^7.1.1",
|
|
42
39
|
"uuid": "^11.1.1",
|
|
43
40
|
"source-map-js": "^1.2.2",
|
|
44
41
|
"shell-quote": "^1.11.0"
|
|
@@ -5,7 +5,5 @@ if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
|
|
|
5
5
|
ionic cordova prepare ios
|
|
6
6
|
open platforms/ios/App.xcworkspace
|
|
7
7
|
else
|
|
8
|
-
ionic cordova
|
|
9
|
-
# Use the .app directly to bypass Ionic's outdated IPA path and ZIP extraction.
|
|
10
|
-
native-run ios --app platforms/ios/App.xcarchive/Products/Applications/Face.app --device
|
|
8
|
+
ionic cordova run ios
|
|
11
9
|
fi
|
|
@@ -11,7 +11,7 @@ Requires Node.js 22+, Xcode 26+, CocoaPods, Android Studio with JDK 17 and Andro
|
|
|
11
11
|
* IOS: `npm run ios`.
|
|
12
12
|
* Android: `npm run android`.
|
|
13
13
|
|
|
14
|
-
**Note**: this is just one way of running the app. You can also pass `-- -o` or `-- --open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE.
|
|
14
|
+
**Note**: this is just one way of running the app. You can also pass `-- -o` or `-- --open` argument to the command, and this will open Xcode/Android Studio, then run the app directly from the IDE. Overall, this is a more consistent way, so if you're having troubles running the app from terminal, try running it from the IDE. Just don't forget to make sure that Metro Bundler is running(`npm start`).
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
## How to use offline match
|
|
@@ -21,6 +21,7 @@ Requires Node.js 22+, Xcode 26+, CocoaPods, Android Studio with JDK 17 and Andro
|
|
|
21
21
|
```bash
|
|
22
22
|
npm uninstall @regulaforensics/face-core-basic
|
|
23
23
|
npm install @regulaforensics/face-core-match
|
|
24
|
+
(cd ios && pod install)
|
|
24
25
|
npm run setup
|
|
25
26
|
```
|
|
26
27
|
|
|
@@ -19,12 +19,9 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
|
|
|
19
19
|
},
|
|
20
20
|
plugins: [
|
|
21
21
|
'@regulaforensics/face-sdk',
|
|
22
|
-
'./scripts/withoutMetroServer',
|
|
23
22
|
['expo-custom-assets', { assetsPaths: ['./assets'] }],
|
|
24
23
|
['expo-build-properties', {
|
|
25
|
-
ios: { networkInspector: false },
|
|
26
24
|
android: {
|
|
27
|
-
networkInspector: false,
|
|
28
25
|
extraMavenRepos: [
|
|
29
26
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader' },
|
|
30
27
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Beta' },
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<meta name="viewport" content="initial-scale=1, user-scalable=no, viewport-fit=cover">
|
|
2
|
+
<link rel="stylesheet" href="src/main.css">
|
|
3
|
+
|
|
4
|
+
<div id="content" style="height: 100%"></div>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
(async () => {
|
|
8
|
+
document.getElementById("content").innerHTML = await fetch("src/main.html").then(r => r.text())
|
|
9
|
+
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
|
|
10
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({ id: "ready" }))
|
|
11
|
+
})()
|
|
12
|
+
</script>
|
|
@@ -6,36 +6,6 @@ import { Alert, Platform } from 'react-native'
|
|
|
6
6
|
import { launchImageLibrary } from 'react-native-image-picker'
|
|
7
7
|
import { main } from './src/main'
|
|
8
8
|
|
|
9
|
-
export async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
10
|
-
if (Platform.OS === 'ios') path = RNFS.MainBundlePath + "/" + path
|
|
11
|
-
var readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileRes
|
|
12
|
-
try {
|
|
13
|
-
return await readFile(path, 'base64')
|
|
14
|
-
} catch {
|
|
15
|
-
return null
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export async function pickImage(): Promise<string | null> {
|
|
20
|
-
var response = await launchImageLibrary({
|
|
21
|
-
mediaType: 'photo',
|
|
22
|
-
selectionLimit: 1,
|
|
23
|
-
includeBase64: true
|
|
24
|
-
})
|
|
25
|
-
return "data:image/png;base64," + response?.assets?.[0].base64!
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export async function chooseOption(): Promise<boolean | null> {
|
|
29
|
-
return new Promise<boolean | null>((resolve) => {
|
|
30
|
-
Alert.alert("Select option", "", [
|
|
31
|
-
{ text: "Use gallery", onPress: () => { resolve(false) } },
|
|
32
|
-
{ text: "Use camera", onPress: () => { resolve(true) } }
|
|
33
|
-
], { cancelable: true, onDismiss: () => resolve(null) })
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// --------------------------------------------------------------------------------------------------------------------
|
|
38
|
-
|
|
39
9
|
var webViewRef: any
|
|
40
10
|
const onclicks: any = {}
|
|
41
11
|
const onMessage = (json: any) => {
|
|
@@ -80,45 +50,45 @@ const document = {
|
|
|
80
50
|
}
|
|
81
51
|
|
|
82
52
|
function parseValue(value: any) {
|
|
83
|
-
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async function loadWebUI() {
|
|
88
|
-
const webRoot = Platform.OS === 'ios' ? RNFS.MainBundlePath + '/web/' : 'web/'
|
|
89
|
-
const readWebFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileAssets
|
|
90
|
-
const readWebDir = Platform.OS === 'ios' ? RNFS.readDir : RNFS.readDirAssets
|
|
91
|
-
const webImages: Record<string, string> = {}
|
|
92
|
-
const [styles, content] = await Promise.all(['src/main.css', 'src/main.html'].map(path => readWebFile(webRoot + path, 'utf8')))
|
|
93
|
-
|
|
94
|
-
for (const file of (await readWebDir(webRoot + 'images')).filter(file => file.isFile())) {
|
|
95
|
-
const extension = file.name.split('.').pop()!.toLowerCase()
|
|
96
|
-
const type = ({ jpg: 'jpeg', svg: 'svg+xml' } as Record<string, string>)[extension] ?? extension
|
|
97
|
-
webImages['images/' + file.name] = `data:image/${type};base64,${await readWebFile(file.path, 'base64')}`
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const html = content.replace(/src="([^"]+)"/g, (match, path) => webImages[path] ? `src="${webImages[path]}"` : match)
|
|
101
|
-
return `<meta name="viewport" content="initial-scale=1, user-scalable=no, viewport-fit=cover">
|
|
102
|
-
<style>${styles}</style>
|
|
103
|
-
<div id="content" style="height: 100%">${html}</div>
|
|
104
|
-
<script>
|
|
105
|
-
window.webImages = ${JSON.stringify(webImages)};
|
|
106
|
-
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
107
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({ id: "ready" }))
|
|
108
|
-
}))
|
|
109
|
-
</script>`
|
|
53
|
+
if (value !== true && value !== false) return `"${value}"`
|
|
54
|
+
return value
|
|
110
55
|
}
|
|
111
56
|
|
|
112
57
|
(globalThis as any).document = document;
|
|
113
|
-
registerRootComponent(() =>
|
|
114
|
-
|
|
115
|
-
React.useEffect(() => { loadWebUI().then(setHtml).catch(console.error) }, [])
|
|
116
|
-
return html ? <WebView
|
|
58
|
+
registerRootComponent(() =>
|
|
59
|
+
<WebView
|
|
117
60
|
ref={ref => { webViewRef = ref }}
|
|
118
61
|
onMessage={onMessage}
|
|
119
|
-
|
|
120
|
-
source={{ html }}
|
|
62
|
+
source={require("./index.html")}
|
|
121
63
|
scrollEnabled={false}
|
|
122
64
|
overScrollMode={'content'}
|
|
123
|
-
/>
|
|
124
|
-
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
export async function loadAssetIfExists(path: string): Promise<string | null> {
|
|
69
|
+
if (Platform.OS === 'ios') path = RNFS.MainBundlePath + "/" + path
|
|
70
|
+
var readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileRes
|
|
71
|
+
try {
|
|
72
|
+
return await readFile(path, 'base64')
|
|
73
|
+
} catch {
|
|
74
|
+
return null
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export async function pickImage(): Promise<string | null> {
|
|
79
|
+
var response = await launchImageLibrary({
|
|
80
|
+
mediaType: 'photo',
|
|
81
|
+
selectionLimit: 1,
|
|
82
|
+
includeBase64: true
|
|
83
|
+
})
|
|
84
|
+
return "data:image/png;base64," + response?.assets?.[0].base64!
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export async function chooseOption(): Promise<boolean | null> {
|
|
88
|
+
return new Promise<boolean | null>((resolve) => {
|
|
89
|
+
Alert.alert("Select option", "", [
|
|
90
|
+
{ text: "Use gallery", onPress: () => { resolve(false) } },
|
|
91
|
+
{ text: "Use camera", onPress: () => { resolve(true) } }
|
|
92
|
+
], { cancelable: true, onDismiss: () => resolve(null) })
|
|
93
|
+
})
|
|
94
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const config = require('expo/metro-config').getDefaultConfig(__dirname)
|
|
2
2
|
config.watchFolders = [
|
|
3
|
+
__dirname + '/node_modules'
|
|
3
4
|
]
|
|
4
|
-
config.resolver.nodeModulesPaths =
|
|
5
|
+
config.resolver.nodeModulesPaths = config.watchFolders
|
|
6
|
+
config.resolver.assetExts.push('css')
|
|
5
7
|
module.exports = config
|