accurascan_kyc 0.1.0

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.
Files changed (66) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +635 -0
  3. package/accurascan-kyc.podspec +38 -0
  4. package/android/build.gradle +118 -0
  5. package/android/gradle.properties +5 -0
  6. package/android/src/main/AndroidManifest.xml +18 -0
  7. package/android/src/main/java/com/accurascankyc/AccurascanKycModule.java +507 -0
  8. package/android/src/main/java/com/accurascankyc/AccurascanKycPackage.java +28 -0
  9. package/android/src/main/java/com/accurascankyc/ActivityFaceMatch.java +533 -0
  10. package/android/src/main/java/com/accurascankyc/BorderTextView.java +82 -0
  11. package/android/src/main/java/com/accurascankyc/OcrActivity.java +1263 -0
  12. package/android/src/main/java/com/accurascankyc/OcrResultActivity.java +736 -0
  13. package/android/src/main/java/com/accurascankyc/ReactNativeJson.java +123 -0
  14. package/android/src/main/java/com/accurascankyc/UnsafeOkHttpClient.java +57 -0
  15. package/android/src/main/res/drawable/btn_bg_gray.xml +6 -0
  16. package/android/src/main/res/drawable/btn_bg_red.xml +6 -0
  17. package/android/src/main/res/drawable/btn_bg_trasparent_bottom.xml +6 -0
  18. package/android/src/main/res/drawable/flip_camera_icon.png +0 -0
  19. package/android/src/main/res/drawable/ic_close.xml +5 -0
  20. package/android/src/main/res/drawable/round_border_rect.xml +12 -0
  21. package/android/src/main/res/drawable/splash.png +0 -0
  22. package/android/src/main/res/drawable-v24/ic_launcher_foreground.png +0 -0
  23. package/android/src/main/res/drawable-xhdpi/bg_home.png +0 -0
  24. package/android/src/main/res/drawable-xhdpi/ic_barcode.png +0 -0
  25. package/android/src/main/res/drawable-xhdpi/ic_biometric.png +0 -0
  26. package/android/src/main/res/drawable-xhdpi/ic_check.png +0 -0
  27. package/android/src/main/res/drawable-xhdpi/ic_liveness.png +0 -0
  28. package/android/src/main/res/drawable-xhdpi/ic_result.png +0 -0
  29. package/android/src/main/res/drawable-xhdpi/ic_scan.png +0 -0
  30. package/android/src/main/res/drawable-xhdpi/img_button_overlay.png +0 -0
  31. package/android/src/main/res/layout/activity_ocr_result.xml +18 -0
  32. package/android/src/main/res/layout/activity_splash.xml +26 -0
  33. package/android/src/main/res/layout/custom_frame_layout.xml +144 -0
  34. package/android/src/main/res/layout/ocr_activity.xml +28 -0
  35. package/android/src/main/res/layout-land/custom_frame_layout.xml +144 -0
  36. package/android/src/main/res/layout-land/ocr_activity.xml +41 -0
  37. package/android/src/main/res/menu/menu_land_port.xml +7 -0
  38. package/android/src/main/res/mipmap-hdpi/logo_loign.png +0 -0
  39. package/android/src/main/res/mipmap-mdpi/logo_loign.png +0 -0
  40. package/android/src/main/res/mipmap-xhdpi/ic_document_verified.png +0 -0
  41. package/android/src/main/res/mipmap-xhdpi/logo_loign.png +0 -0
  42. package/android/src/main/res/mipmap-xxhdpi/logo_loign.png +0 -0
  43. package/android/src/main/res/values/colors.xml +31 -0
  44. package/android/src/main/res/values/strings.xml +42 -0
  45. package/android/src/main/res/values/styles.xml +191 -0
  46. package/ios/AccurascanKyc-Bridging-Header.h +2 -0
  47. package/ios/AccurascanKyc.m +34 -0
  48. package/ios/AccurascanKyc.swift +649 -0
  49. package/ios/AccurascanKyc.xcodeproj/project.pbxproj +283 -0
  50. package/ios/AccurascanKyc.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  51. package/ios/FMController.swift +587 -0
  52. package/ios/LVController.swift +346 -0
  53. package/ios/MainStoryboard_iPhone.storyboard +338 -0
  54. package/ios/ViewController.swift +2686 -0
  55. package/ios/resources/back_icon.png +0 -0
  56. package/ios/resources/flip_camera_icon.png +0 -0
  57. package/ios/resources/flip_document_icon.png +0 -0
  58. package/ios/resources/ic_logo.png +0 -0
  59. package/lib/commonjs/index.js +13 -0
  60. package/lib/commonjs/index.js.map +1 -0
  61. package/lib/module/index.js +6 -0
  62. package/lib/module/index.js.map +1 -0
  63. package/lib/typescript/index.d.ts +3 -0
  64. package/lib/typescript/index.d.ts.map +1 -0
  65. package/package.json +161 -0
  66. package/src/index.tsx +5 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Accura Scan
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,635 @@
1
+ # React Native Accura Scan KYC
2
+
3
+ Accura Scan OCR is used for Optical character recognition.
4
+
5
+ Accura Scan Face Match is used for Matching 2 Faces, Source face and Target face. It matches the User Image from a Selfie vs User Image in document.
6
+
7
+ Accura Scan Authentication is used for your customer verification and authentication. Unlock the True Identity of Your Users with 3D Selfie Technology
8
+
9
+ Below steps to setup Accura Scan's SDK to your project.
10
+
11
+ ## Note:-
12
+
13
+ `yarn add 'accurascan_kyc'`
14
+ **Usage**
15
+ Import flutter library into file.
16
+ `import AccurascanKyc from 'accurascan_kyc';`
17
+
18
+ ## 1.Setup Android
19
+
20
+ **Add this permissions into Android’s AndroidManifest.xml file.**
21
+
22
+ ```
23
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
24
+ <uses-permission android:name="android.permission.CAMERA" />
25
+ <uses-feature android:name="android.hardware.camera" />
26
+ <uses-feature android:name="android.hardware.camera.autofocus" />
27
+ ```
28
+
29
+ **Add it in your root build.gradle at the end of repositories.**
30
+
31
+ ```
32
+ allprojects {
33
+ repositories {
34
+ google()
35
+ jcenter()
36
+ maven {
37
+ url 'https://jitpack.io'
38
+ credentials { username 'jp_ssguccab6c5ge2l4jitaj92ek2' }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ **Add it in your app/build.gradle file.**
45
+
46
+ ```
47
+ packagingOptions {
48
+ pickFirst 'lib/arm64-v8a/libcrypto.so'
49
+ pickFirst 'lib/arm64-v8a/libssl.so'
50
+
51
+ pickFirst 'lib/armeabi-v7a/libcrypto.so'
52
+ pickFirst 'lib/armeabi-v7a/libssl.so'
53
+
54
+ pickFirst 'lib/x86/libcrypto.so'
55
+ pickFirst 'lib/x86/libssl.so'
56
+
57
+ pickFirst 'lib/x86_64/libcrypto.so'
58
+ pickFirst 'lib/x86_64/libssl.so'
59
+
60
+ }
61
+ ```
62
+
63
+ ## 2.Setup iOS
64
+
65
+ 1.Install Git LFS using command install `git-lfs`
66
+
67
+ 2.Run `pod install`
68
+
69
+ **Add this permissions into iOS Info.plist file.**
70
+
71
+ ```
72
+ <key>NSCameraUsageDescription</key>
73
+ <string>App usage camera for scan documents.</string>
74
+ <key>NSPhotoLibraryUsageDescription</key>
75
+ <string>App usage photos for get document picture.</string>
76
+ <key>NSPhotoLibraryAddUsageDescription</key>
77
+ <string>App usage photos for save document picture.</string>
78
+ ```
79
+
80
+ ## 3.Setup Accura Scan licenses into your projects
81
+
82
+ Accura Scan has two license require for use full functionality of this library. Generate your own Accura license from here
83
+ **key.license**
84
+
85
+ This license is compulsory for this library to work. it will get all setup of accura SDK.
86
+
87
+ **accuraface.license**
88
+
89
+ This license is use for get face match percentages between two face pictures.
90
+
91
+ **For Android**
92
+
93
+ ```
94
+ Create "assets" folder under app/src/main and Add license file in to assets folder.
95
+ - key.license // for Accura Scan OCR
96
+ - accuraface.license // for Accura Scan Face Match
97
+ Generate your Accura Scan license from https://accurascan.com/developer/dashboard
98
+ ```
99
+
100
+ **For iOS**
101
+
102
+ ```
103
+ Place both the license in your project's Runner directory, and add the licenses to the target.
104
+ ```
105
+
106
+ ## 4.Get license configuration from SDK. It returns all active functionalities of your license.
107
+
108
+ ### Setting up License
109
+
110
+ ```
111
+ getAccuraSetup = () => {
112
+ //Method for get license info from native OS.
113
+ AccurascanKyc.getMetaData((error, response) => {
114
+ if (error != null) {
115
+
116
+ } else {
117
+ console.log(response);
118
+ }
119
+ });
120
+ };
121
+ ```
122
+
123
+ **Error:** String
124
+
125
+ **Success:** JSON String Response = {
126
+
127
+ **countries:** Array[<CountryModels>],
128
+
129
+ **barcodes:** Array[],
130
+
131
+ **isValid:** boolean,
132
+
133
+ **isOCREnable:** boolean,
134
+
135
+ **isBarcodeEnable:** boolean,
136
+
137
+ **isBankCardEnable:** boolean,
138
+
139
+ **isMRZEnable:** boolean
140
+
141
+ }
142
+
143
+ ### Setting up Configuration's,Error mssages and Scaning title messages
144
+
145
+ ```
146
+ setUpCustomMessages = () => {
147
+ var config = {
148
+ setFaceBlurPercentage: 80,
149
+ setHologramDetection: true,
150
+ setLowLightTolerance: 10,
151
+ setMotionThreshold: 25,
152
+ setMinGlarePercentage: 6,
153
+ setMaxGlarePercentage: 99,
154
+ setBlurPercentage: 60,
155
+ setCameraFacing: 0,
156
+ };
157
+
158
+ var accuraConfigs = {
159
+ enableLogs: 1,
160
+ setCameraFacing: 0,
161
+ isShowLogo: 1,
162
+ isFlipImg: 1,
163
+ CameraScreen_Frame_Color: '#D5323F',
164
+ CameraScreen_Text_Color: '#FFFFFF',
165
+ CameraScreen_Text_Border_Color: '#000000',
166
+ CameraScreen_Color: '#80000000',
167
+ CameraScreen_Back_Button: 1,
168
+ CameraScreen_Change_Button: 1,
169
+ ACCURA_ERROR_CODE_MOTION: 'Keep Document Steady',
170
+ ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME: 'Keep document in frame',
171
+ ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME: 'Bring card near to frame',
172
+ ACCURA_ERROR_CODE_PROCESSING: 'Processing...',
173
+ ACCURA_ERROR_CODE_BLUR_DOCUMENT: 'Blur detect in document',
174
+ ACCURA_ERROR_CODE_FACE_BLUR: 'Blur detected over face',
175
+ ACCURA_ERROR_CODE_GLARE_DOCUMENT: 'Glare detect in document',
176
+ ACCURA_ERROR_CODE_HOLOGRAM: 'Hologram Detected',
177
+ ACCURA_ERROR_CODE_DARK_DOCUMENT: 'Low lighting detected',
178
+ ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT:
179
+ 'Can not accept Photo Copy Document',
180
+ ACCURA_ERROR_CODE_FACE: 'Face not detected',
181
+ ACCURA_ERROR_CODE_MRZ: 'MRZ not detected',
182
+ ACCURA_ERROR_CODE_PASSPORT_MRZ: 'Passport MRZ not detected',
183
+ ACCURA_ERROR_CODE_ID_MRZ: 'ID MRZ not detected',
184
+ ACCURA_ERROR_CODE_VISA_MRZ: 'Visa MRZ not detected',
185
+ ACCURA_ERROR_CODE_UPSIDE_DOWN_SIDE:
186
+ 'Document is upside down. Place it properly',
187
+ ACCURA_ERROR_CODE_WRONG_SIDE: 'Scanning wrong side of Document',
188
+ };
189
+
190
+ var accuraTitleMsg = {
191
+ SCAN_TITLE_OCR_FRONT: 'Scan Front side of ',
192
+ SCAN_TITLE_OCR_BACK: 'Scan Back side of ',
193
+ SCAN_TITLE_OCR: 'Scan ',
194
+ SCAN_TITLE_MRZ_PDF417_FRONT: 'Scan Front Side of Document',
195
+ SCAN_TITLE_MRZ_PDF417_BACK: 'Scan Back Side of Document',
196
+ SCAN_TITLE_DLPLATE: 'Scan Number plate',
197
+ SCAN_TITLE_BARCODE: 'Scan Barcode',
198
+ SCAN_TITLE_BANKCARD: 'Scan BankCard',
199
+ };
200
+
201
+ //Method for setup config into native OS.
202
+ AccurascanKyc.setupAccuraConfig(
203
+ [config, accuraConfigs, accuraTitleMsg],
204
+ (error, response) => {
205
+ if (error != null) {
206
+ console.log('Failur!', error);
207
+ } else {
208
+ console.log('Message:- ', response);
209
+ }
210
+ }
211
+ );
212
+ };
213
+
214
+ ```
215
+
216
+ ## 5.Method for scan MRZ documents.
217
+
218
+ ```
219
+ onPressMRZ = () => {
220
+ var isValid = true;
221
+ if (this.mrzSelected === '' || this.mrzSelected === null) {
222
+ this.setState({ isValidType: false });
223
+ isValid = false;
224
+ }
225
+
226
+ if (isValid) {
227
+ let passArgs = [this.mrzSelected];
228
+ //Method for start MRZ scaning from native OS.
229
+ AccurascanKyc.startMRZ(passArgs, (error, response) => {
230
+ if (error != null) {
231
+ console.log('Failure!', error);
232
+ this.showAlert('Failure!', error);
233
+ } else {
234
+ console.log('Success!', response);
235
+ }
236
+ });
237
+ }
238
+ };
239
+ ```
240
+
241
+ **MRZType:** String
242
+
243
+ #### value: other_mrz or passport_mrz or id_mrz or visa_mrz<br></br>
244
+
245
+ **Success:** JSON Response {
246
+
247
+ **front_data:** JSONObjects?,
248
+
249
+ **back_data:** JSONObjects?,
250
+
251
+ **type:** Recognition Type,
252
+
253
+ **face:** URI?
254
+
255
+ **front_img:** URI?
256
+
257
+ **back_img:** URI?
258
+
259
+ }
260
+
261
+ **Error:** String
262
+
263
+ ## 6.Method for scan OCR documents.
264
+
265
+ ```
266
+ onPressOCR = () => {
267
+ var isValid = true;
268
+ if (this.countrySelected === null || this.countrySelected === '') {
269
+ this.setState({ isValidCountry: false });
270
+ isValid = false;
271
+ }
272
+
273
+ if (this.cardSelected === null || this.cardSelected === '') {
274
+ this.setState({ isValidCard: false });
275
+ isValid = false;
276
+ }
277
+
278
+ if (isValid) {
279
+ let passArgs = [
280
+ this.countrySelected.id,
281
+ this.cardSelected.id,
282
+ this.cardSelected.name,
283
+ this.cardSelected.type,
284
+ ]; //[{"enableLogs":false},1,41,"Emirates National ID",0,"portrait-primary"]
285
+ //Method for start OCR scaning from native OS.
286
+ AccurascanKyc.startOcrWithCard(passArgs, (error, response) => {
287
+ if (error != null) {
288
+ console.log('Failure!', error);
289
+ } else {
290
+ console.log('Success!', response);
291
+ }
292
+ });
293
+ }
294
+ };
295
+ ```
296
+
297
+ **CountryId:** integer
298
+
299
+ **value:** Id of selected country.
300
+
301
+ **CardId:** integer
302
+
303
+ **value:** Id of selected card.
304
+
305
+ **CardName:** String
306
+
307
+ **value:** Name of selected card.
308
+
309
+ **CardType:** integer
310
+
311
+ **value:** Type of selected card.
312
+
313
+ **Success:** JSON Response {
314
+ }
315
+
316
+ **Error:** String
317
+
318
+ ## 7.Method for scan barcode.
319
+
320
+ ```
321
+ onPressBarcode = () => {
322
+ var isValid = true;
323
+ if (this.barcodeSelected?.toString() === '') {
324
+ this.setState({ isValidBarcodeType: false });
325
+ isValid = false;
326
+ }
327
+
328
+ if (isValid) {
329
+ let passArgs = [this.barcodeSelected];
330
+ //Method for start MRZ scaning from native OS.
331
+ AccurascanKyc.startBarcode(passArgs, (error, response) => {
332
+ if (error != null) {
333
+ console.log('Failure!', error);
334
+ } else {
335
+ console.log('Success!', response);
336
+ }
337
+ });
338
+ }
339
+ };
340
+ ```
341
+
342
+ **BarcodeType:** String
343
+
344
+ **value:** Type of barcode documents.
345
+
346
+ **Success:** JSON Response {
347
+ }
348
+
349
+ **Error:** String
350
+
351
+ ## 8.Method for scan bankcard.
352
+
353
+ ```
354
+ onPressBankcard = () => {
355
+ AccurascanKyc.startBankCard((error, response) => {
356
+ if (error != null) {
357
+ console.log('Failure!', error);
358
+ } else {
359
+ console.log('Success!', response);
360
+ }
361
+ });
362
+ };
363
+ ```
364
+
365
+ **Success:** JSON Response {
366
+ }
367
+
368
+ **Error:** String
369
+
370
+ ## 8.Method for get face match percentages between two face.
371
+
372
+ ```
373
+ onPressFaceMatch = () => {
374
+ var accuraConfs = {
375
+ face_uri: this.facematchURI,
376
+ };
377
+ var fconfig = {
378
+ backGroundColor: '#FFC4C4C5',
379
+ closeIconColor: '#FF000000',
380
+ feedbackBackGroundColor: '#FFC4C4C5',
381
+ feedbackTextColor: '#FF000000',
382
+ setFeedbackTextSize: 18,
383
+ setFeedBackframeMessage: 'Frame Your Face',
384
+ setFeedBackAwayMessage: 'Move Phone Away',
385
+ setFeedBackOpenEyesMessage: 'Keep Your Eyes Open',
386
+ setFeedBackCloserMessage: 'Move Phone Closer',
387
+ setFeedBackCenterMessage: 'Move Phone Center',
388
+ setFeedbackMultipleFaceMessage: 'Multiple Face Detected',
389
+ setFeedBackFaceSteadymessage: 'Keep Your Head Straight',
390
+ setFeedBackLowLightMessage: 'Low light detected',
391
+ setFeedBackBlurFaceMessage: 'Blur Detected Over Face',
392
+ setFeedBackGlareFaceMessage: 'Glare Detected',
393
+ setBlurPercentage: 80,
394
+ setGlarePercentage_0: -1,
395
+ setGlarePercentage_1: -1,
396
+ feedbackDialogMessage: 'Loading...',
397
+ feedBackProcessingMessage: 'Processing...',
398
+ isShowLogo: 1,
399
+ };
400
+ let passArgs = [accuraConfs, fconfig];
401
+
402
+ AccurascanKyc.startFaceMatch(passArgs, (error, response) => {
403
+ if (error != null) {
404
+ console.log('Failur!', error);
405
+ } else {
406
+ console.log('Success!', response);
407
+ }
408
+ });
409
+ };
410
+ ```
411
+
412
+ **accuraConfs:** JSON Object
413
+
414
+ **face_uri:** URI
415
+
416
+ **Success:** JSON Response {
417
+ detect: URI?
418
+ score: Float
419
+ }
420
+
421
+ **Error:** String
422
+
423
+ ## 9.Method for liveness check.
424
+
425
+ ```
426
+ onPressStartLiveness = () => {
427
+ var accuraConfs = {
428
+ face_uri: this.facematchURI,
429
+ };
430
+
431
+ var lconfig = {
432
+ backGroundColor: '#FFC4C4C5',
433
+ closeIconColor: '#FF000000',
434
+ feedbackBackGroundColor: '#FFC4C4C5',
435
+ feedbackTextColor: '#FF000000',
436
+ setFeedbackTextSize: 18,
437
+ setFeedBackframeMessage: 'Frame Your Face',
438
+ setFeedBackAwayMessage: 'Move Phone Away',
439
+ setFeedBackOpenEyesMessage: 'Keep Your Eyes Open',
440
+ setFeedBackCloserMessage: 'Move Phone Closer',
441
+ setFeedBackCenterMessage: 'Move Phone Center',
442
+ setFeedbackMultipleFaceMessage: 'Multiple Face Detected',
443
+ setFeedBackFaceSteadymessage: 'Keep Your Head Straight',
444
+ setFeedBackBlurFaceMessage: 'Blur Detected Over Face',
445
+ setFeedBackGlareFaceMessage: 'Glare Detected',
446
+ setBlurPercentage: 80,
447
+ setGlarePercentage_0: -1,
448
+ setGlarePercentage_1: -1,
449
+ setLivenessURL: 'Your URL',
450
+ setFeedBackLowLightMessage: 'Low light detected',
451
+ feedbackLowLightTolerence: 39,
452
+ feedbackDialogMessage: 'Loading...',
453
+ feedBackProcessingMessage: 'Processing...',
454
+ isShowLogo: 1,
455
+ };
456
+
457
+ let passArgs = [accuraConfs, lconfig];
458
+
459
+ AccurascanKyc.startLiveness(passArgs, (error, response) => {
460
+ if (error != null) {
461
+ console.log('Failure!', error);
462
+ this.showAlert('Failure!', error);
463
+ } else {
464
+ console.log('Success!', response);
465
+ }
466
+ });
467
+ };
468
+ ```
469
+
470
+ **accuraConfs:** JSON Object
471
+
472
+ **face_uri:** 'uri of face'
473
+
474
+ **Success:** JSON Response {
475
+
476
+ detect: URI?,
477
+
478
+ Face_score: Float,
479
+
480
+ score: Float,
481
+
482
+ }
483
+
484
+ **Error:** String
485
+
486
+ ## 10.Method for Only Facematch.(The following are Optional methods, Use if you need only FaceMatch)
487
+
488
+ ### To Open Gallery 1 and 2:-
489
+
490
+ _For gallery 1_
491
+
492
+ ```
493
+ openGallery = () => {
494
+ var accuraConfs = {
495
+ face1: this.state.FirstFMImageURI,
496
+ face2: this.state.SecondFMImageURI,
497
+ };
498
+
499
+ AccurascanKyc.openGallery1([accuraConfs], (error, response) => {
500
+ if (error != null) {
501
+ console.log('Failure!', error);
502
+ } else {
503
+ console.log('Success!', response);
504
+ }
505
+ });
506
+ };
507
+ ```
508
+
509
+ _For gallery 2_
510
+
511
+ ```
512
+ openGallery2 = () => {
513
+ var accuraConfs = {
514
+ face1: this.state.FirstFMImageURI,
515
+ face2: this.state.SecondFMImageURI,
516
+ };
517
+
518
+ AccurascanKyc.openGallery2([accuraConfs], (error, response) => {
519
+ if (error != null) {
520
+ console.log('Failure!', error);
521
+ } else {
522
+ console.log('Success!', response);
523
+ }
524
+ });
525
+ };
526
+ ```
527
+
528
+ ### To Open Camera for Facematch 1 and 2:
529
+
530
+ _For Facematch 1:_
531
+
532
+ ```
533
+ onPressFaceMatch1 = () => {
534
+ var accuraConfs = {
535
+ face1: this.state.FirstFMImageURI,
536
+ face2: this.state.SecondFMImageURI,
537
+ };
538
+ var fconfig = {
539
+ backGroundColor: '#FFC4C4C5',
540
+ closeIconColor: '#FF000000',
541
+ feedbackBackGroundColor: '#FFC4C4C5',
542
+ feedbackTextColor: '#FF000000',
543
+ setFeedbackTextSize: 18,
544
+ setFeedBackframeMessage: 'Frame Your Face',
545
+ setFeedBackAwayMessage: 'Move Phone Away',
546
+ setFeedBackOpenEyesMessage: 'Keep Your Eyes Open',
547
+ setFeedBackCloserMessage: 'Move Phone Closer',
548
+ setFeedBackCenterMessage: 'Move Phone Center',
549
+ setFeedbackMultipleFaceMessage: 'Multiple Face Detected',
550
+ setFeedBackFaceSteadymessage: 'Keep Your Head Straight',
551
+ setFeedBackLowLightMessage: 'Low light detected',
552
+ setFeedBackBlurFaceMessage: 'Blur Detected Over Face',
553
+ setFeedBackGlareFaceMessage: 'Glare Detected',
554
+ setBlurPercentage: 80,
555
+ setGlarePercentage_0: -1,
556
+ setGlarePercentage_1: -1,
557
+ feedbackDialogMessage: 'Loading...',
558
+ feedBackProcessingMessage: 'Processing...',
559
+ isShowLogo: 1,
560
+ };
561
+ let passArgs = [accuraConfs, fconfig];
562
+
563
+ AccurascanKyc.startFaceMatch1(passArgs, (error, response) => {
564
+ if (error != null) {
565
+ console.log('Failure!', error);
566
+ } else {
567
+ console.log('Success!', response);
568
+ }
569
+ });
570
+ };
571
+ ```
572
+
573
+ _For Facematch 2_
574
+
575
+ ```
576
+ onPressFaceMatch2 = () => {
577
+ var accuraConfs = {
578
+ face1: this.state.FirstFMImageURI,
579
+ face2: this.state.SecondFMImageURI,
580
+ };
581
+ var fconfig = {
582
+ backGroundColor: '#FFC4C4C5',
583
+ closeIconColor: '#FF000000',
584
+ feedbackBackGroundColor: '#FFC4C4C5',
585
+ feedbackTextColor: '#FF000000',
586
+ setFeedbackTextSize: 18,
587
+ setFeedBackframeMessage: 'Frame Your Face',
588
+ setFeedBackAwayMessage: 'Move Phone Away',
589
+ setFeedBackOpenEyesMessage: 'Keep Your Eyes Open',
590
+ setFeedBackCloserMessage: 'Move Phone Closer',
591
+ setFeedBackCenterMessage: 'Move Phone Center',
592
+ setFeedbackMultipleFaceMessage: 'Multiple Face Detected',
593
+ setFeedBackFaceSteadymessage: 'Keep Your Head Straight',
594
+ setFeedBackLowLightMessage: 'Low light detected',
595
+ setFeedBackBlurFaceMessage: 'Blur Detected Over Face',
596
+ setFeedBackGlareFaceMessage: 'Glare Detected',
597
+ setBlurPercentage: 80,
598
+ setGlarePercentage_0: -1,
599
+ setGlarePercentage_1: -1,
600
+ feedbackDialogMessage: 'Loading...',
601
+ feedBackProcessingMessage: 'Processing...',
602
+ isShowLogo: 1,
603
+ };
604
+ let passArgs = [accuraConfs, fconfig];
605
+
606
+ AccurascanKyc.startFaceMatch2(passArgs, (error, response) => {
607
+ if (error != null) {
608
+ console.log('Failure!', error);
609
+ } else {
610
+ console.log('Success!', response);
611
+ }
612
+ });
613
+ };
614
+ ```
615
+
616
+ **accuraConfs:** JSON Object
617
+
618
+ **Face1:** 'uri of face1'
619
+
620
+ **Face2:** ’uri of face2’
621
+
622
+ **Success:** JSON Response {
623
+
624
+ **Image:** URI?,
625
+
626
+ **score:** String,
627
+ }
628
+
629
+ **Error:** String
630
+
631
+ Contributing
632
+ See the contributing guide to learn how to contribute to the repository and the development workflow.
633
+
634
+ License:
635
+ MIT
@@ -0,0 +1,38 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "accurascan-kyc"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => "12.0" }
15
+ s.ios.deployment_target = '12.0'
16
+ s.source = { :git => "https://github.com/Anaslokhandwala/react_native_accurascan_kyc.git/accurascan_kyc.git", :tag => "#{s.version}" }
17
+
18
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
19
+ s.resources = "ios/**/*.{png,jpeg,jpg,xib,xcassets,imageset,gif,mp3,storyboard}"
20
+
21
+ s.dependency "React-Core"
22
+ s.static_framework = true
23
+ s.dependency "AccuraKYC_Sim","3.2.2"
24
+ # Don't install the dependencies when we run `pod install` in the old architecture.
25
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
26
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
27
+ s.pod_target_xcconfig = {
28
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
29
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
30
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
31
+ }
32
+ # s.dependency "React-Codegen"
33
+ # s.dependency "RCT-Folly"
34
+ # s.dependency "RCTRequired"
35
+ # s.dependency "RCTTypeSafety"
36
+ # s.dependency "ReactCommon/turbomodule/core"
37
+ end
38
+ end