@regulaforensics/face-sdk 8.5.1516-rc → 8.5.1519-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/Package.swift +1 -1
- package/android/build.gradle.kts +1 -1
- package/android/cordova.gradle.kts +1 -1
- package/examples/capacitor/package-lock.json +0 -555
- package/examples/capacitor/package.json +2 -2
- package/examples/ionic/README.md +2 -2
- package/examples/ionic/package-lock.json +4477 -568
- package/examples/ionic/package.json +6 -3
- package/examples/ionic/scripts/ios.sh +3 -1
- package/examples/react_native/README.md +1 -2
- package/examples/react_native/app.config.ts +3 -0
- package/examples/react_native/index.tsx +65 -35
- package/examples/react_native/metro.config.js +1 -3
- package/examples/react_native/package-lock.json +1158 -1159
- package/examples/react_native/package.json +13 -22
- package/examples/react_native/scripts/android.sh +1 -8
- package/examples/react_native/scripts/ios.sh +3 -11
- package/examples/react_native/scripts/setup.sh +1 -5
- package/examples/react_native/scripts/withoutMetroServer.js +86 -0
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/react-native-face-sdk.podspec +2 -2
- package/test/package-lock.json +2 -5
- package/examples/react_native/index.html +0 -12
|
@@ -15,19 +15,22 @@
|
|
|
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",
|
|
18
19
|
"@ionic/angular": "^9.0.4",
|
|
19
20
|
"@ionic/cordova-builders": "^13.0.0",
|
|
20
21
|
"@awesome-cordova-plugins/camera": "^9.6.0",
|
|
21
22
|
"@awesome-cordova-plugins/dialogs": "^9.6.0",
|
|
22
23
|
"@awesome-cordova-plugins/file": "^9.6.0",
|
|
23
|
-
"@regulaforensics/face-sdk": "8.5.
|
|
24
|
-
"@regulaforensics/face-core-basic": "8.5.
|
|
24
|
+
"@regulaforensics/face-sdk": "8.5.1519-nightly",
|
|
25
|
+
"@regulaforensics/face-core-basic": "8.5.920-nightly",
|
|
26
|
+
"cordova": "^13.0.0",
|
|
25
27
|
"cordova-android": "^15.1.0",
|
|
26
28
|
"cordova-ios": "^8.1.1",
|
|
27
29
|
"cordova-plugin-camera": "^8.0.0",
|
|
28
30
|
"cordova-plugin-dialogs": "^2.0.2",
|
|
29
31
|
"cordova-plugin-file": "^8.1.3",
|
|
30
32
|
"cordova-plugin-ionic-webview": "^5.0.1",
|
|
33
|
+
"native-run": "^2.0.3",
|
|
31
34
|
"patch-package": "^8.0.1",
|
|
32
35
|
"@angular/compiler": "^22.1.7",
|
|
33
36
|
"@angular/platform-browser": "^22.1.7",
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
"typescript": "~6.0.3"
|
|
36
39
|
},
|
|
37
40
|
"overrides": {
|
|
38
|
-
"serialize-javascript": "^7.1.
|
|
41
|
+
"serialize-javascript": "^7.1.2",
|
|
39
42
|
"uuid": "^11.1.1",
|
|
40
43
|
"source-map-js": "^1.2.2",
|
|
41
44
|
"shell-quote": "^1.11.0"
|
|
@@ -5,5 +5,7 @@ if [[ " $* " == *" --open "* ]] || [[ " $* " == *" -o "* ]]; then
|
|
|
5
5
|
ionic cordova prepare ios
|
|
6
6
|
open platforms/ios/App.xcworkspace
|
|
7
7
|
else
|
|
8
|
-
ionic cordova
|
|
8
|
+
ionic cordova build ios --device
|
|
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
|
|
9
11
|
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.
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
## How to use offline match
|
|
@@ -21,7 +21,6 @@ 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)
|
|
25
24
|
npm run setup
|
|
26
25
|
```
|
|
27
26
|
|
|
@@ -19,9 +19,12 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
|
|
|
19
19
|
},
|
|
20
20
|
plugins: [
|
|
21
21
|
'@regulaforensics/face-sdk',
|
|
22
|
+
'./scripts/withoutMetroServer',
|
|
22
23
|
['expo-custom-assets', { assetsPaths: ['./assets'] }],
|
|
23
24
|
['expo-build-properties', {
|
|
25
|
+
ios: { networkInspector: false },
|
|
24
26
|
android: {
|
|
27
|
+
networkInspector: false,
|
|
25
28
|
extraMavenRepos: [
|
|
26
29
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader' },
|
|
27
30
|
{ url: 'https://maven.regulaforensics.com/RegulaDocumentReader/Beta' },
|
|
@@ -6,6 +6,36 @@ 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
|
+
|
|
9
39
|
var webViewRef: any
|
|
10
40
|
const onclicks: any = {}
|
|
11
41
|
const onMessage = (json: any) => {
|
|
@@ -50,45 +80,45 @@ const document = {
|
|
|
50
80
|
}
|
|
51
81
|
|
|
52
82
|
function parseValue(value: any) {
|
|
53
|
-
|
|
54
|
-
return value
|
|
83
|
+
const json = JSON.stringify(value)
|
|
84
|
+
return typeof value === 'string' ? `(window.webImages[${json}] ?? ${json})` : json
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
scrollEnabled={false}
|
|
64
|
-
overScrollMode={'content'}
|
|
65
|
-
/>
|
|
66
|
-
)
|
|
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')))
|
|
67
93
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return await readFile(path, 'base64')
|
|
73
|
-
} catch {
|
|
74
|
-
return null
|
|
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')}`
|
|
75
98
|
}
|
|
76
|
-
}
|
|
77
99
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
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>`
|
|
85
110
|
}
|
|
86
111
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
112
|
+
(globalThis as any).document = document;
|
|
113
|
+
registerRootComponent(() => {
|
|
114
|
+
const [html, setHtml] = React.useState('')
|
|
115
|
+
React.useEffect(() => { loadWebUI().then(setHtml).catch(console.error) }, [])
|
|
116
|
+
return html ? <WebView
|
|
117
|
+
ref={ref => { webViewRef = ref }}
|
|
118
|
+
onMessage={onMessage}
|
|
119
|
+
originWhitelist={['*']}
|
|
120
|
+
source={{ html }}
|
|
121
|
+
scrollEnabled={false}
|
|
122
|
+
overScrollMode={'content'}
|
|
123
|
+
/> : null
|
|
124
|
+
})
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const config = require('expo/metro-config').getDefaultConfig(__dirname)
|
|
2
2
|
config.watchFolders = [
|
|
3
|
-
__dirname + '/node_modules'
|
|
4
3
|
]
|
|
5
|
-
config.resolver.nodeModulesPaths =
|
|
6
|
-
config.resolver.assetExts.push('css')
|
|
4
|
+
config.resolver.nodeModulesPaths = [__dirname + '/node_modules']
|
|
7
5
|
module.exports = config
|