File tree 9 files changed +56
-11
lines changed
sdk-integration-examples/web-sdk
9 files changed +56
-11
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export class AppComponent {
28
28
29
29
private onSdkReady = ( ) => {
30
30
console . log ( "Successfully loaded" ) ;
31
+ this . loading = false ;
31
32
} ;
32
33
33
34
private onScanSuccess = ( ev : IdverseSdkUiCustomEvent < any > ) => {
@@ -83,7 +84,14 @@ export class AppComponent {
83
84
}
84
85
85
86
onhandleStart ( ) {
86
- if ( this . idverseSdk && this . ready ) this . idverseSdk . startFaceScan ( ) ;
87
+ if ( this . idverseSdk && this . ready ) {
88
+ this . loading = true ;
89
+ try {
90
+ this . idverseSdk . startFaceScan ( ) ;
91
+ } catch ( e ) {
92
+ console . error ( e ) ;
93
+ }
94
+ }
87
95
}
88
96
onClearError ( ) {
89
97
this . errorText = null ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export class AppComponent {
30
30
31
31
private onSdkReady = ( ) => {
32
32
console . log ( "Successfully loaded" ) ;
33
+ this . loading = false ;
33
34
} ;
34
35
35
36
private onScanSuccess = ( ev : IdverseSdkUiCustomEvent < any > ) => {
@@ -72,7 +73,8 @@ export class AppComponent {
72
73
}
73
74
this . idverseSdk . recognizers = [ SdkType . IDScan ] ;
74
75
this . idverseSdk . enableDFA = true ;
75
- this . idverseSdk . enableFaceMatch = true ;
76
+ // INFO: Set to true when IDScan is used in combination with FaceScan, and a Face Match result is required.
77
+ this . idverseSdk . enableFaceMatch = false ;
76
78
77
79
this . idverseSdk . addEventListener ( "ready" , this . onSdkReady ) ;
78
80
this . idverseSdk . addEventListener ( "fatalError" , this . onError ) ;
@@ -83,10 +85,14 @@ export class AppComponent {
83
85
84
86
onhandleStart ( state : boolean ) {
85
87
this . scanBothSides = state ;
86
-
87
88
if ( this . idverseSdk && this . ready ) {
89
+ this . loading = true ;
88
90
this . idverseSdk . setScanBothSides ( state ) ;
89
- this . idverseSdk . startIDScan ( ) ;
91
+ try {
92
+ this . idverseSdk . startIDScan ( ) ;
93
+ } catch ( e ) {
94
+ console . error ( e ) ;
95
+ }
90
96
}
91
97
}
92
98
onClearError ( ) {
Original file line number Diff line number Diff line change
1
+ # Logs
2
+ logs
3
+ * .log
4
+ npm-debug.log *
5
+ yarn-debug.log *
6
+ yarn-error.log *
7
+ pnpm-debug.log *
8
+ lerna-debug.log *
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ * .local
14
+
15
+ # Editor directories and files
16
+ .vscode /*
17
+ ! .vscode /extensions.json
18
+ .idea
19
+ .DS_Store
20
+ * .suo
21
+ * .ntvs *
22
+ * .njsproj
23
+ * .sln
24
+ * .sw ?
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ function App() {
77
77
78
78
const handleStart = async ( ) => {
79
79
if ( ! idverseSDK || ! ready ) return ;
80
+ setLoading ( true ) ;
80
81
try {
81
82
idverseSDK . startFaceScan ( ) ;
82
83
} catch ( e ) {
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ function App() {
67
67
}
68
68
sdk . recognizers = [ SdkType . IDScan ] ;
69
69
sdk . enableDFA = true ;
70
- sdk . enableFaceMatch = true ;
70
+ // INFO: Set to true when IDScan is used in combination with FaceScan, and a Face Match result is required.
71
+ sdk . enableFaceMatch = false ;
71
72
72
73
sdk . addEventListener ( "ready" , onSdkReady ) ;
73
74
sdk . addEventListener ( "fatalError" , onError ) ;
@@ -83,6 +84,7 @@ function App() {
83
84
if ( ! idverseSDK || ! ready ) return ;
84
85
setScanBothSides ( state ) ;
85
86
idverseSDK . setScanBothSides ( state ) ;
87
+ setLoading ( true ) ;
86
88
try {
87
89
idverseSDK . startIDScan ( ) ;
88
90
} catch ( e ) {
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import HelloWorld from " ./components/HelloWorld .vue" ;
2
+ import Main from " ./components/Main .vue" ;
3
3
</script >
4
4
5
5
<template >
@@ -8,7 +8,7 @@ import HelloWorld from "./components/HelloWorld.vue";
8
8
<img src =" /logo.svg" class =" logo" alt =" Idverse logo" />
9
9
</a >
10
10
</div >
11
- <HelloWorld />
11
+ <Main />
12
12
</template >
13
13
14
14
<style scoped>
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import { ref , onMounted } from " vue" ;
3
- import Details from " ./Details.vue" ;
4
3
import " @idverse/idverse-sdk-browser/ui" ;
5
4
import {
6
5
FaceScanRecognizerResult ,
@@ -17,6 +16,7 @@ const idverseSDK = ref<HTMLIdverseSdkUiElement | null>(null);
17
16
18
17
const onSdkReady = () => {
19
18
console .log (" Successfully loaded" );
19
+ loading .value = false ;
20
20
};
21
21
22
22
const onScanSuccess = (ev : IdverseSdkUiCustomEvent <any >) => {
@@ -47,6 +47,7 @@ const closeSession = () => {
47
47
48
48
const handleStart = async () => {
49
49
if (! idverseSDK .value || ! ready .value ) return ;
50
+ loading .value = true ;
50
51
try {
51
52
idverseSDK .value .startFaceScan ();
52
53
} catch (e ) {
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import HelloWorld from " ./components/HelloWorld .vue" ;
2
+ import Main from " ./components/Main .vue" ;
3
3
</script >
4
4
5
5
<template >
@@ -8,7 +8,7 @@ import HelloWorld from "./components/HelloWorld.vue";
8
8
<img src =" /logo.svg" class =" logo" alt =" Idverse logo" />
9
9
</a >
10
10
</div >
11
- <HelloWorld />
11
+ <Main />
12
12
</template >
13
13
14
14
<style scoped>
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const idverseSDK = ref<HTMLIdverseSdkUiElement | null>(null);
18
18
19
19
const onSdkReady = () => {
20
20
console .log (" Successfully loaded" );
21
+ loading .value = false ;
21
22
};
22
23
23
24
const onScanSuccess = (ev : IdverseSdkUiCustomEvent <any >) => {
@@ -48,6 +49,7 @@ const closeSession = () => {
48
49
49
50
const handleStart = async (state : boolean ) => {
50
51
if (! idverseSDK || ! ready ) return ;
52
+ loading .value = true ;
51
53
scanBothSides .value = state ;
52
54
idverseSDK .value ?.setScanBothSides (state );
53
55
try {
@@ -76,7 +78,8 @@ onMounted(() => {
76
78
77
79
sdk .recognizers = [SdkType .IDScan ];
78
80
sdk .enableDFA = true ;
79
- sdk .enableFaceMatch = true ;
81
+ // INFO: Set to true when IDScan is used in combination with FaceScan, and a Face Match result is required.
82
+ sdk .enableFaceMatch = false ;
80
83
81
84
sdk .addEventListener (" ready" , onSdkReady );
82
85
sdk .addEventListener (" fatalError" , onError );
You can’t perform that action at this time.
0 commit comments