accurascan_kyc 1.0.4 → 1.0.5

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 CHANGED
@@ -11,21 +11,17 @@ Below steps to setup Accura Scan's SDK to your project.
11
11
  ## Note:-
12
12
 
13
13
  `yarn add 'accurascan_kyc'`
14
+
15
+ OR
16
+
17
+ `npm i accurascan_kyc`
18
+
14
19
  **Usage**
15
- Import flutter library into file.
20
+ Import npm library into file.
16
21
  `import AccurascanKyc from 'accurascan_kyc';`
17
22
 
18
23
  ## 1.Setup Android
19
24
 
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
25
  **Add it in your root build.gradle at the end of repositories.**
30
26
 
31
27
  ```
@@ -72,7 +68,35 @@ splits {
72
68
 
73
69
  1.Install Git LFS using command install `git-lfs`
74
70
 
75
- 2.Run `pod install`
71
+ 2.Add the following in your podfile
72
+ `use_frameworks!` below `prepare_react_native_project!`
73
+
74
+ and if your xcode version is less than 14, add the following code
75
+
76
+ ```
77
+ installer.pods_project.targets.each do |target|
78
+ target.build_configurations.each do |config|
79
+ # Bitcode is deprecated by Apple
80
+ config.build_settings['ENABLE_BITCODE'] = 'NO'
81
+ end
82
+ end
83
+ ```
84
+
85
+ below
86
+
87
+ ```
88
+ post_install do |installer|
89
+ react_native_post_install(
90
+ installer,
91
+ # Set `mac_catalyst_enabled` to `true` in order to apply patches
92
+ # necessary for Mac Catalyst builds
93
+ :mac_catalyst_enabled => false
94
+ )
95
+ ```
96
+
97
+ take reference from [here](https://github.com/Anaslokhandwala/Accurascan_KYC/blob/master/ios/Podfile)
98
+
99
+ 3.Run `pod install`
76
100
 
77
101
  **Add this permissions into iOS Info.plist file.**
78
102
 
@@ -87,7 +111,8 @@ splits {
87
111
 
88
112
  ## 3.Setup Accura Scan licenses into your projects
89
113
 
90
- Accura Scan has two license require for use full functionality of this library. Generate your own Accura license from here
114
+ Accura Scan has two license require for use full functionality of this library. Generate your own Accura license from [here](https://accurascan.com/developer/dashboard) using your bundle id.
115
+
91
116
  **key.license**
92
117
 
93
118
  This license is compulsory for this library to work. it will get all setup of accura SDK.
@@ -131,21 +156,13 @@ Place both the license in your project's Runner directory, and add the licenses
131
156
  **Error:** String
132
157
 
133
158
  **Success:** JSON String Response = {
134
-
135
- **countries:** Array[<CountryModels>],
136
-
137
- **barcodes:** Array[],
138
-
139
- **isValid:** boolean,
140
-
141
- **isOCREnable:** boolean,
142
-
143
- **isBarcodeEnable:** boolean,
144
-
145
- **isBankCardEnable:** boolean,
146
-
147
- **isMRZEnable:** boolean
148
-
159
+ countries: Array[<CountryModels>],
160
+ barcodes: Array[],
161
+ isValid: boolean,
162
+ isOCREnable: boolean,
163
+ isBarcodeEnable: boolean,
164
+ isBankCardEnable: boolean,
165
+ isMRZEnable: boolean
149
166
  }
150
167
 
151
168
  ### Setting up Configuration's,Error mssages and Scaning title messages
@@ -251,19 +268,12 @@ onPressMRZ = () => {
251
268
  #### value: other_mrz or passport_mrz or id_mrz or visa_mrz<br></br>
252
269
 
253
270
  **Success:** JSON Response {
254
-
255
- **front_data:** JSONObjects?,
256
-
257
- **back_data:** JSONObjects?,
258
-
259
- **type:** Recognition Type,
260
-
261
- **face:** URI?
262
-
263
- **front_img:** URI?
264
-
265
- **back_img:** URI?
266
-
271
+ front_data: JSONObjects?,
272
+ back_data: JSONObjects?,
273
+ type: Recognition Type,
274
+ face: URI?
275
+ front_img: URI?
276
+ back_img: URI?
267
277
  }
268
278
 
269
279
  **Error:** String
@@ -285,10 +295,10 @@ onPressOCR = () => {
285
295
 
286
296
  if (isValid) {
287
297
  let passArgs = [
288
- this.countrySelected.id,
289
- this.cardSelected.id,
290
- this.cardSelected.name,
291
- this.cardSelected.type,
298
+ this.countrySelected.id, //integer
299
+ this.cardSelected.id, //integer
300
+ this.cardSelected.name, //String
301
+ this.cardSelected.type, //integer
292
302
  ]; //[{"enableLogs":false},1,41,"Emirates National ID",0,"portrait-primary"]
293
303
  //Method for start OCR scaning from native OS.
294
304
  AccurascanKyc.startOcrWithCard(passArgs, (error, response) => {
@@ -302,25 +312,7 @@ onPressOCR = () => {
302
312
  };
303
313
  ```
304
314
 
305
- **CountryId:** integer
306
-
307
- **value:** Id of selected country.
308
-
309
- **CardId:** integer
310
-
311
- **value:** Id of selected card.
312
-
313
- **CardName:** String
314
-
315
- **value:** Name of selected card.
316
-
317
- **CardType:** integer
318
-
319
- **value:** Type of selected card.
320
-
321
- **Success:** JSON Response {
322
- }
323
-
315
+ **Success:** JSON Response
324
316
  **Error:** String
325
317
 
326
318
  ## 7.Method for scan barcode.
@@ -347,13 +339,7 @@ onPressBarcode = () => {
347
339
  };
348
340
  ```
349
341
 
350
- **BarcodeType:** String
351
-
352
- **value:** Type of barcode documents.
353
-
354
- **Success:** JSON Response {
355
- }
356
-
342
+ **Success:** JSON Response
357
343
  **Error:** String
358
344
 
359
345
  ## 8.Method for scan bankcard.
@@ -370,9 +356,7 @@ onPressBankcard = () => {
370
356
  };
371
357
  ```
372
358
 
373
- **Success:** JSON Response {
374
- }
375
-
359
+ **Success:** JSON Response
376
360
  **Error:** String
377
361
 
378
362
  ## 8.Method for get face match percentages between two face.
@@ -417,10 +401,6 @@ onPressFaceMatch = () => {
417
401
  };
418
402
  ```
419
403
 
420
- **accuraConfs:** JSON Object
421
-
422
- **face_uri:** URI
423
-
424
404
  **Success:** JSON Response {
425
405
  detect: URI?
426
406
  score: Float
@@ -475,18 +455,10 @@ onPressStartLiveness = () => {
475
455
  };
476
456
  ```
477
457
 
478
- **accuraConfs:** JSON Object
479
-
480
- **face_uri:** 'uri of face'
481
-
482
458
  **Success:** JSON Response {
483
-
484
459
  detect: URI?,
485
-
486
460
  Face_score: Float,
487
-
488
461
  score: Float,
489
-
490
462
  }
491
463
 
492
464
  **Error:** String
@@ -622,16 +594,12 @@ _For Facematch 2_
622
594
  ```
623
595
 
624
596
  **accuraConfs:** JSON Object
625
-
626
597
  **Face1:** 'uri of face1'
627
-
628
598
  **Face2:** ’uri of face2’
629
599
 
630
600
  **Success:** JSON Response {
631
-
632
- **Image:** URI?,
633
-
634
- **score:** String,
601
+ Image: URI?,
602
+ score: String,
635
603
  }
636
604
 
637
605
  **Error:** String
@@ -21,7 +21,6 @@ Pod::Spec.new do |s|
21
21
  s.dependency "React-Core"
22
22
  s.static_framework = true
23
23
  s.dependency "AccuraKYC_Sim","3.2.2"
24
- s.dependency "SVProgressHUD"
25
24
  # Don't install the dependencies when we run `pod install` in the old architecture.
26
25
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
27
26
  s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
@@ -96,9 +96,7 @@ dependencies {
96
96
  // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
97
97
  //noinspection GradleDynamicVersion
98
98
  implementation "com.facebook.react:react-native:+"
99
-
100
99
  implementation fileTree(dir: 'libs', include: ['*.jar'])
101
-
102
100
  implementation 'androidx.appcompat:appcompat:1.6.0'
103
101
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
104
102
  // For Accura OCR SDK
@@ -107,6 +105,7 @@ dependencies {
107
105
  implementation 'com.github.accurascan:AccuraFaceMatch:3.2.0'
108
106
  // for liveness
109
107
  implementation 'com.github.accurascan:Liveness-Android:3.2.0'
108
+ implementation 'com.squareup.picasso:picasso:2.71828'
110
109
  }
111
110
 
112
111
  if (isNewArchitectureEnabled()) {
@@ -0,0 +1,100 @@
1
+ package com.accurascankyc;
2
+
3
+ import android.content.Context;
4
+ import android.graphics.Canvas;
5
+ import android.graphics.Paint;
6
+ import android.graphics.Path;
7
+ import android.util.AttributeSet;
8
+ import android.widget.RelativeLayout;
9
+
10
+ import androidx.annotation.NonNull;
11
+ import androidx.annotation.Nullable;
12
+
13
+ public class AccuraCardBorderView extends RelativeLayout {
14
+
15
+ private Paint mBorderPaint;
16
+ private boolean cornerBox = false;
17
+ private int mCornerWidth = 150;
18
+ private int mBorderColor = 0xFFCC0000;
19
+ private int mBorderWidth = 10;
20
+
21
+ public AccuraCardBorderView(@NonNull Context context) {
22
+ super(context);
23
+ init();
24
+ }
25
+
26
+ public AccuraCardBorderView(@NonNull Context context, @Nullable AttributeSet attrs) {
27
+ super(context, attrs);
28
+ init();
29
+ }
30
+
31
+ public AccuraCardBorderView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
32
+ super(context, attrs, defStyleAttr);
33
+ init();
34
+ }
35
+
36
+ private void init() {
37
+ mBorderPaint = new Paint(Paint.DITHER_FLAG);
38
+ mBorderPaint.setStyle(Paint.Style.STROKE);
39
+ mBorderPaint.setStrokeWidth(mBorderWidth);
40
+ mBorderPaint.setColor(mBorderColor);
41
+ }
42
+
43
+ public void setCornerBox(boolean cornerBox) {
44
+ this.cornerBox = cornerBox;
45
+ }
46
+
47
+ public void setCornerWidth(int mCornerWidth) {
48
+ this.mCornerWidth = mCornerWidth;
49
+ }
50
+
51
+ public void setBorderColor(int mBorderColor) {
52
+ this.mBorderColor = mBorderColor;
53
+ }
54
+
55
+ public void setBorderWidth(int mBorderWidth) {
56
+ this.mBorderWidth = mBorderWidth;
57
+ }
58
+
59
+ @Override
60
+ protected void dispatchDraw(Canvas canvas) {
61
+ int count = canvas.save();
62
+ mBorderPaint.setStrokeWidth(mBorderWidth);
63
+ mBorderPaint.setColor(mBorderColor);
64
+ if (cornerBox) {
65
+ canvas.drawPath(createCornersPath(0, 0, getWidth(), getHeight(), mCornerWidth), mBorderPaint);
66
+ } else {
67
+ canvas.drawPath(createRectanglePath(0, 0, getWidth(), getHeight()), mBorderPaint);
68
+ }
69
+ super.dispatchDraw(canvas);
70
+ canvas.restoreToCount(count);
71
+ }
72
+
73
+ private Path createCornersPath(int left, int top, int right, int bottom, int cornerWidth){
74
+ Path path = new Path();
75
+
76
+ path.moveTo(left, top + cornerWidth);
77
+ path.lineTo(left, top);
78
+ path.lineTo(left + cornerWidth, top);
79
+
80
+ path.moveTo(right - cornerWidth, top);
81
+ path.lineTo(right, top);
82
+ path.lineTo(right , top + cornerWidth);
83
+
84
+ path.moveTo(left, bottom - cornerWidth);
85
+ path.lineTo(left, bottom);
86
+ path.lineTo(left + cornerWidth, bottom);
87
+
88
+ path.moveTo(right - cornerWidth, bottom);
89
+ path.lineTo(right, bottom);
90
+ path.lineTo(right, bottom - cornerWidth);
91
+
92
+ return path;
93
+ }
94
+
95
+ private Path createRectanglePath(int left, int top, int right, int bottom){
96
+ Path path = new Path();
97
+ path.addRect(left, top, right, bottom, Path.Direction.CW);
98
+ return path;
99
+ }
100
+ }
@@ -3,6 +3,7 @@ package com.accurascankyc;
3
3
  import androidx.annotation.NonNull;
4
4
  import androidx.core.app.ActivityCompat;
5
5
 
6
+
6
7
  import android.os.Build;
7
8
  import android.content.Context;
8
9
  import com.accurascan.ocr.mrz.model.BarcodeFormat;
@@ -19,6 +20,8 @@ import com.facebook.react.bridge.ReactMethod;
19
20
  import com.facebook.react.bridge.ReadableArray;
20
21
  import com.facebook.react.module.annotations.ReactModule;
21
22
  import com.facebook.react.bridge.Callback;
23
+ import org.json.JSONException;
24
+ import org.json.JSONObject;
22
25
 
23
26
  import android.Manifest;
24
27
  import android.content.ContentResolver;
@@ -40,6 +43,7 @@ import java.io.IOException;
40
43
  import java.io.InputStream;
41
44
  import java.io.OutputStream;
42
45
  import java.util.HashMap;
46
+ import java.util.Iterator;
43
47
  import java.util.List;
44
48
  import java.util.Map;
45
49
  import java.util.Objects;
@@ -55,6 +59,10 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
55
59
  public static JSONObject accuraErrorConfg = new JSONObject();
56
60
  public static JSONObject accuraTitleMsg = new JSONObject();
57
61
  public static JSONObject accuraConfigs = new JSONObject();
62
+ public static JSONObject actualAccuraConfigs = new JSONObject();
63
+ public static JSONObject actualAccuraTitleMsg = new JSONObject();
64
+ public static JSONObject actualAccuraErrorConfg = new JSONObject();
65
+
58
66
  private String bType;
59
67
 
60
68
  public AccurascanKycModule(ReactApplicationContext reactContext) {
@@ -184,12 +192,98 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
184
192
  @ReactMethod
185
193
  public boolean setupAccuraConfig(ReadableArray argsNew, Callback result) throws JSONException {
186
194
 
195
+ //Configs
196
+ actualAccuraConfigs.put("setFaceBlurPercentage",80);
197
+ actualAccuraConfigs.put("setHologramDetection",true);
198
+ actualAccuraConfigs.put("setLowLightTolerance",10);
199
+ actualAccuraConfigs.put("setMotionThreshold",25);
200
+ actualAccuraConfigs.put("setMinGlarePercentage",6);
201
+ actualAccuraConfigs.put("setMaxGlarePercentage",99);
202
+ actualAccuraConfigs.put("setBlurPercentage",60);
203
+ actualAccuraConfigs.put("setCameraFacing",0);
204
+
205
+ //Title messages
206
+ actualAccuraTitleMsg.put("SCAN_TITLE_OCR_FRONT","Scan Front side of ");
207
+ actualAccuraTitleMsg.put("SCAN_TITLE_OCR_BACK","Scan Back side of ");
208
+ actualAccuraTitleMsg.put("SCAN_TITLE_OCR","Scan ");
209
+ actualAccuraTitleMsg.put("SCAN_TITLE_MRZ_PDF417_FRONT","Scan Front Side of Document");
210
+ actualAccuraTitleMsg.put("SCAN_TITLE_MRZ_PDF417_BACK","Scan Back Side of Document");
211
+ actualAccuraTitleMsg.put("SCAN_TITLE_DLPLATE","Scan Number plate");
212
+ actualAccuraTitleMsg.put("SCAN_TITLE_BARCODE","Scan Barcode");
213
+ actualAccuraTitleMsg.put("SCAN_TITLE_BANKCARD","Scan BankCard");
214
+
215
+ //Error messages, Camera Screen Confige
216
+ actualAccuraErrorConfg.put("flipImage","");
217
+ actualAccuraErrorConfg.put("setCameraFacing",0);
218
+ actualAccuraErrorConfg.put("enableLogs",1);
219
+ actualAccuraErrorConfg.put("isShowLogo",1);
220
+ actualAccuraErrorConfg.put("isFlipImg",1);
221
+ actualAccuraErrorConfg.put("CameraScreen_Frame_Color","#D5323F");
222
+ actualAccuraErrorConfg.put("CameraScreen_Text_Color","#FFFFFF");
223
+ actualAccuraErrorConfg.put("CameraScreen_Text_Border_Color","#000000");
224
+ actualAccuraErrorConfg.put("CameraScreen_Color","#80000000");
225
+ actualAccuraErrorConfg.put("CameraScreen_Border_Width",10);
226
+ actualAccuraErrorConfg.put("CameraScreen_CornerBorder_Enable",false);
227
+ actualAccuraErrorConfg.put("CameraScreen_Back_Button",1);
228
+ actualAccuraErrorConfg.put("CameraScreen_Change_Button",1);
229
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_MOTION","Keep Document Steady");
230
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME","Keep document in frame");
231
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME","Bring card near to frame");
232
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_PROCESSING","Processing...");
233
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_BLUR_DOCUMENT","Blur detect in document");
234
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_FACE_BLUR","Blur detected over face");
235
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_GLARE_DOCUMENT","Glare detect in document");
236
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_HOLOGRAM","Hologram Detected");
237
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_DARK_DOCUMENT","Low lighting detected");
238
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT","Can not accept Photo Copy Document");
239
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_FACE","Face not detected");
240
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_MRZ","MRZ not detected");
241
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_PASSPORT_MRZ","Passport MRZ not detected");
242
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_ID_MRZ","ID MRZ not detected");
243
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_VISA_MRZ","Visa MRZ not detected");
244
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_UPSIDE_DOWN_SIDE","Document is upside down. Place it properly");
245
+ actualAccuraErrorConfg.put("ACCURA_ERROR_CODE_WRONG_SIDE","Scanning wrong side of Document");
246
+
247
+
187
248
  JSONArray args = ReactNativeJSON.convertArrayToJson(argsNew);
188
249
  RecogEngine recogEngine = new RecogEngine();
189
250
 
190
- accuraConfigs = args.getJSONObject(0);
191
- accuraErrorConfg = args.getJSONObject(1);
192
- accuraTitleMsg = args.getJSONObject(2);
251
+ // accuraConfigs = args.getJSONObject(0);
252
+ Iterator<String> keys1 = actualAccuraConfigs.keys();
253
+ while(keys1.hasNext()) {
254
+ String key = keys1.next();
255
+ accuraConfigs.put(key, actualAccuraConfigs.get(key));
256
+ }
257
+ Iterator<String> keys2 = args.getJSONObject(0).keys();
258
+ while(keys2.hasNext()) {
259
+ String key = keys2.next();
260
+ accuraConfigs.put(key, args.getJSONObject(0).get(key));
261
+ }
262
+
263
+ // accuraErrorConfg = args.getJSONObject(1);
264
+ Iterator<String> keys3 = actualAccuraErrorConfg.keys();
265
+ while(keys3.hasNext()) {
266
+ String key = keys3.next();
267
+ accuraErrorConfg.put(key, actualAccuraErrorConfg.get(key));
268
+ }
269
+ Iterator<String> keys4 = args.getJSONObject(1).keys();
270
+ while(keys4.hasNext()) {
271
+ String key = keys4.next();
272
+ accuraErrorConfg.put(key, args.getJSONObject(1).get(key));
273
+ }
274
+
275
+ // accuraTitleMsg = args.getJSONObject(2);
276
+ Iterator<String> keys5 = actualAccuraTitleMsg.keys();
277
+ while(keys5.hasNext()) {
278
+ String key = keys5.next();
279
+ accuraTitleMsg.put(key, actualAccuraTitleMsg.get(key));
280
+ }
281
+ Iterator<String> keys6 = args.getJSONObject(2).keys();
282
+ while(keys6.hasNext()) {
283
+ String key = keys6.next();
284
+ accuraTitleMsg.put(key, args.getJSONObject(2).get(key));
285
+ }
286
+
193
287
 
194
288
  OcrActivity.accuraErrorConfg = accuraErrorConfg;
195
289
  OcrActivity.accuraTitleMsg = accuraTitleMsg;
@@ -503,5 +597,5 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
503
597
  }
504
598
  return resultOf;
505
599
  }
506
-
600
+
507
601
  }
@@ -10,6 +10,7 @@ import android.graphics.Rect;
10
10
  import android.graphics.Color;
11
11
  import android.graphics.Paint;
12
12
  import android.graphics.drawable.GradientDrawable;
13
+ import android.net.Uri;
13
14
  import android.os.Bundle;
14
15
  import android.os.Handler;
15
16
  import android.os.Message;
@@ -41,6 +42,7 @@ import com.accurascan.ocr.mrz.util.AccuraLog;
41
42
  import com.docrecog.scan.MRZDocumentType;
42
43
  import com.docrecog.scan.RecogEngine;
43
44
  import com.docrecog.scan.RecogType;
45
+ import com.squareup.picasso.Picasso;
44
46
 
45
47
  import org.json.JSONException;
46
48
  import org.json.JSONObject;
@@ -69,7 +71,8 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
69
71
 
70
72
  private static final String TAG = OcrActivity.class.getSimpleName();
71
73
  private CameraView cameraView;
72
- private View viewLeft, viewRight, borderFrame,logoImg,viewTop,viewBottom;
74
+ private View viewLeft, viewRight,logoImg,viewTop,viewBottom;
75
+ private AccuraCardBorderView borderFrame;
73
76
  private BorderTextView tvTitle, tvScanMessage;
74
77
  private ImageView imageFlip;
75
78
  private int cardId;
@@ -249,15 +252,31 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
249
252
  }
250
253
  });
251
254
 
252
- // try {
253
- // if (accuraErrorConfg.getInt("CameraScreen_Change_Button") == 0){
254
- // btn_flip.setVisibility(View.GONE);
255
- // }else{
256
- // }
257
- // } catch (JSONException e) {
258
- // e.printStackTrace();
259
- // }
255
+ try {
256
+ borderFrame.setBorderColor(Color.parseColor(accuraErrorConfg.getString("CameraScreen_Frame_Color")));
257
+ borderFrame.setBorderWidth(accuraErrorConfg.getInt("CameraScreen_Border_Width"));
258
+ borderFrame.setCornerBox(accuraErrorConfg.getBoolean("CameraScreen_CornerBorder_Enable"));
259
+ } catch (JSONException e) {
260
+ e.printStackTrace();
261
+ }
260
262
 
263
+ try {
264
+ if (accuraErrorConfg.getInt("CameraScreen_Change_Button") == 0){
265
+ btn_flip.setVisibility(View.GONE);
266
+ }else{
267
+ }
268
+ } catch (JSONException e) {
269
+ e.printStackTrace();
270
+ }
271
+
272
+ try {
273
+ if (!accuraErrorConfg.getString("flipImage").equals("")){
274
+ String aaa = accuraErrorConfg.getString("flipImage");
275
+ Picasso.get().load(aaa).into(imageFlip);
276
+ }
277
+ } catch (JSONException e) {
278
+ e.printStackTrace();
279
+ }
261
280
 
262
281
  String screenColor = "#00000000";
263
282
  try {
@@ -288,9 +307,9 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
288
307
  } catch (JSONException e) {
289
308
  e.printStackTrace();
290
309
  }
291
- GradientDrawable drawable = (GradientDrawable)borderFrame.getBackground();
292
- drawable.mutate(); // only change this instance of the xml, not all components using this xml
293
- drawable.setStroke(dp2Px(borderWidth), Color.parseColor(borderColor));
310
+ // GradientDrawable drawable = (GradientDrawable)borderFrame.getBackground();
311
+ // drawable.mutate(); // only change this instance of the xml, not all components using this xml
312
+ // drawable.setStroke(dp2Px(borderWidth), Color.parseColor(borderColor));
294
313
  // drawable.setCornerRadius(dp2Px(borderCornerRadius));
295
314
 
296
315
  String titleTextColor = "#ffffff";
@@ -83,7 +83,7 @@
83
83
 
84
84
  </RelativeLayout>
85
85
 
86
- <RelativeLayout
86
+ <com.accurascankyc.AccuraCardBorderView
87
87
  android:id="@+id/border_frame"
88
88
  tools:layout_conversion_absoluteHeight="300dp"
89
89
  tools:layout_conversion_absoluteWidth="98dp"
@@ -92,7 +92,6 @@
92
92
  android:layout_width="match_parent"
93
93
  android:layout_height="200dp"
94
94
  android:layout_margin="10dp"
95
- android:background="@drawable/border_red"
96
95
  app:layout_constraintBottom_toBottomOf="parent"
97
96
  app:layout_constraintLeft_toLeftOf="parent"
98
97
  app:layout_constraintRight_toRightOf="parent"
@@ -138,7 +137,7 @@
138
137
  />
139
138
  </LinearLayout>
140
139
 
141
- </RelativeLayout>
140
+ </com.accurascankyc.AccuraCardBorderView>
142
141
 
143
142
 
144
143
  </androidx.constraintlayout.widget.ConstraintLayout>
@@ -83,7 +83,7 @@
83
83
 
84
84
  </RelativeLayout>
85
85
 
86
- <RelativeLayout
86
+ <com.accurascankyc.AccuraCardBorderView
87
87
  android:id="@+id/border_frame"
88
88
  tools:layout_conversion_absoluteHeight="300dp"
89
89
  tools:layout_conversion_absoluteWidth="98dp"
@@ -92,7 +92,6 @@
92
92
  android:layout_width="match_parent"
93
93
  android:layout_height="400dp"
94
94
  android:layout_margin="10dp"
95
- android:background="@drawable/border_red"
96
95
  app:layout_constraintBottom_toBottomOf="parent"
97
96
  app:layout_constraintLeft_toLeftOf="parent"
98
97
  app:layout_constraintRight_toRightOf="parent"
@@ -138,7 +137,7 @@
138
137
  />
139
138
  </LinearLayout>
140
139
 
141
- </RelativeLayout>
140
+ </com.accurascankyc.AccuraCardBorderView>
142
141
 
143
142
 
144
143
  </androidx.constraintlayout.widget.ConstraintLayout>
@@ -1,7 +1,6 @@
1
1
  import Foundation
2
2
  import UIKit
3
3
  import AccuraOCR
4
-
5
4
  struct lvfm {
6
5
  static var face1: UIImage? = nil
7
6
  static var face2: UIImage? = nil
@@ -23,6 +22,64 @@ class AccurascanKyc: NSObject {
23
22
  var viewController: UIViewController? = nil;
24
23
  var viewControllerWindow: UIWindow? = nil;
25
24
 
25
+ var actualConfig:NSDictionary = [
26
+ "setFaceBlurPercentage": 80,
27
+ "setHologramDetection": true,
28
+ "setLowLightTolerance": 10,
29
+ "setMotionThreshold": 25,
30
+ "setMinGlarePercentage": 6,
31
+ "setMaxGlarePercentage": 99,
32
+ "setBlurPercentage": 60,
33
+ "setCameraFacing": 0,
34
+ ];
35
+
36
+ var actualAccuraConfigs:NSDictionary = [
37
+ "flipImage":"",
38
+ "enableLogs": 1,
39
+ "setCameraFacing": 0,
40
+ "isShowLogo": 1,
41
+ "isFlipImg": 1,
42
+ "CameraScreen_CornerBorder_Enable":false,
43
+ "CameraScreen_Border_Width":10,
44
+ "CameraScreen_Frame_Color": "#D5323F",
45
+ "CameraScreen_Text_Color": "#FFFFFF",
46
+ "CameraScreen_Text_Border_Color": "#000000",
47
+ "CameraScreen_Color": "#80000000",
48
+ "CameraScreen_Back_Button": 1,
49
+ "CameraScreen_Change_Button": 1,
50
+ "ACCURA_ERROR_CODE_MOTION": "Keep Document Steady",
51
+ "ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME": "Keep document in frame",
52
+ "ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME": "Bring card near to frame",
53
+ "ACCURA_ERROR_CODE_PROCESSING": "Processing...",
54
+ "ACCURA_ERROR_CODE_BLUR_DOCUMENT": "Blur detect in document",
55
+ "ACCURA_ERROR_CODE_FACE_BLUR": "Blur detected over face",
56
+ "ACCURA_ERROR_CODE_GLARE_DOCUMENT": "Glare detect in document",
57
+ "ACCURA_ERROR_CODE_HOLOGRAM": "Hologram Detected",
58
+ "ACCURA_ERROR_CODE_DARK_DOCUMENT": "Low lighting detected",
59
+ "ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT":
60
+ "Can not accept Photo Copy Document",
61
+ "ACCURA_ERROR_CODE_FACE": "Face not detected",
62
+ "ACCURA_ERROR_CODE_MRZ": "MRZ not detected",
63
+ "ACCURA_ERROR_CODE_PASSPORT_MRZ": "Passport MRZ not detected",
64
+ "ACCURA_ERROR_CODE_ID_MRZ": "ID MRZ not detected",
65
+ "ACCURA_ERROR_CODE_VISA_MRZ": "Visa MRZ not detected",
66
+ "ACCURA_ERROR_CODE_UPSIDE_DOWN_SIDE":
67
+ "Document is upside down. Place it properly",
68
+ "ACCURA_ERROR_CODE_WRONG_SIDE": "Scanning wrong side of Document",
69
+ ];
70
+
71
+ var actualAccuraTitleMsg:NSDictionary = [
72
+ "SCAN_TITLE_OCR_FRONT": "Scan Front side of ",
73
+ "SCAN_TITLE_OCR_BACK": "Scan Back side of ",
74
+ "SCAN_TITLE_OCR": "Scan ",
75
+ "SCAN_TITLE_MRZ_PDF417_FRONT": "Scan Front Side of Document",
76
+ "SCAN_TITLE_MRZ_PDF417_BACK": "Scan Back Side of Document",
77
+ "SCAN_TITLE_DLPLATE": "Scan Number plate",
78
+ "SCAN_TITLE_BARCODE": "Scan Barcode",
79
+ "SCAN_TITLE_BANKCARD": "Scan BankCard",
80
+ ];
81
+
82
+
26
83
  @objc(multiply:withB:withResolver:withRejecter:)
27
84
  func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
28
85
  resolve(a*b)
@@ -158,54 +215,57 @@ class AccurascanKyc: NSObject {
158
215
  self.goNativeCallBack = callback
159
216
  self.goNativeArgs = argsNew;
160
217
  print("\(self.goNativeArgs)")
161
- let configs = goNativeArgs[0] as? NSDictionary
162
- accuraTitleMsg = goNativeArgs[2] as! NSDictionary
163
- accuraconfigs = goNativeArgs[1] as! NSDictionary
218
+ let aaaaa = (goNativeArgs[0] as? NSDictionary)!
219
+ let bbbbb = goNativeArgs[1] as! NSDictionary
220
+ let ccccc = goNativeArgs[2] as! NSDictionary
221
+ let configs = actualConfig + aaaaa
222
+ accuraTitleMsg = actualAccuraTitleMsg + ccccc
223
+ accuraconfigs = actualAccuraConfigs + bbbbb
164
224
  var results:[String: Any] = [:]
165
225
 
166
226
 
167
- if configs?["setFaceBlurPercentage"] != nil {
168
- let val = (configs?["setFaceBlurPercentage"] as? Int32)!
227
+ if configs["setFaceBlurPercentage"] != nil {
228
+ let val = (configs["setFaceBlurPercentage"] as? Int32)!
169
229
  self.accuraCameraWrapper?.setFaceBlurPercentage(val)
170
230
  }else{
171
231
  self.accuraCameraWrapper?.setFaceBlurPercentage(80)
172
232
  }
173
- if configs?["setHologramDetection"] != nil {
174
- let val = (configs?["setHologramDetection"] as? Bool)!
233
+ if configs["setHologramDetection"] != nil {
234
+ let val = (configs["setHologramDetection"] as? Bool)!
175
235
  self.accuraCameraWrapper?.setHologramDetection(val)
176
236
  }else{
177
237
  self.accuraCameraWrapper?.setHologramDetection(true)
178
238
  }
179
- if configs?["setLowLightTolerance"] != nil {
180
- let val = (configs?["setLowLightTolerance"] as? Int32)!
239
+ if configs["setLowLightTolerance"] != nil {
240
+ let val = (configs["setLowLightTolerance"] as? Int32)!
181
241
  self.accuraCameraWrapper?.setLowLightTolerance(val)
182
242
  }else{
183
243
  self.accuraCameraWrapper?.setLowLightTolerance(10)
184
244
  }
185
- if configs?["setMotionThreshold"] != nil {
186
- let val = (configs?["setMotionThreshold"] as? Int32)!
245
+ if configs["setMotionThreshold"] != nil {
246
+ let val = (configs["setMotionThreshold"] as? Int32)!
187
247
  self.accuraCameraWrapper?.setMotionThreshold(val)
188
248
  }else{
189
249
  self.accuraCameraWrapper?.setMotionThreshold(25)
190
250
  }
191
- if configs?["setMinGlarePercentage"] != nil && configs?["setMaxGlarePercentage"] != nil {
192
- let val1 = (configs?["setMinGlarePercentage"] as? Int32)!
193
- let val2 = (configs?["setMaxGlarePercentage"] as? Int32)!
251
+ if configs["setMinGlarePercentage"] != nil && configs["setMaxGlarePercentage"] != nil {
252
+ let val1 = (configs["setMinGlarePercentage"] as? Int32)!
253
+ let val2 = (configs["setMaxGlarePercentage"] as? Int32)!
194
254
 
195
255
  self.accuraCameraWrapper?.setGlarePercentage(val1, intMax: val2)
196
256
  }else{
197
257
  self.accuraCameraWrapper?.setGlarePercentage(6, intMax: 99)
198
258
  }
199
- if configs?["setBlurPercentage"] != nil {
200
- let val = (configs?["setBlurPercentage"] as? Int32)!
259
+ if configs["setBlurPercentage"] != nil {
260
+ let val = (configs["setBlurPercentage"] as? Int32)!
201
261
  self.accuraCameraWrapper?.setBlurPercentage(val)
202
262
  }else{
203
263
  self.accuraCameraWrapper?.setBlurPercentage(60)
204
264
  }
205
- if configs?["setCameraFacing"] != nil {
206
- if configs?["setCameraFacing"] as? Int == 0{
265
+ if configs["setCameraFacing"] != nil {
266
+ if configs["setCameraFacing"] as? Int == 0{
207
267
  self.accuraCameraWrapper?.setCameraFacing(.CAMERA_FACING_BACK)
208
- }else if configs?["setCameraFacing"] as? Int == 1{
268
+ }else if configs["setCameraFacing"] as? Int == 1{
209
269
  self.accuraCameraWrapper?.setCameraFacing(.CAMERA_FACING_FRONT)
210
270
  }
211
271
  }else{
@@ -284,7 +344,6 @@ class AccurascanKyc: NSObject {
284
344
  viewController.reactViewController = self.viewController
285
345
  viewController.accuraTitleMsg = self.accuraTitleMsg
286
346
  viewController.accuraErrorCode = self.accuraconfigs
287
- print(self.accuraconfigs)
288
347
  viewController.modalPresentationStyle = .fullScreen
289
348
  viewController.modalTransitionStyle = .coverVertical
290
349
  // DispatchQueue.main.async {
@@ -521,7 +580,6 @@ class AccurascanKyc: NSObject {
521
580
  return
522
581
  }
523
582
  let accuraConfigs1 = self.goNativeArgs[0] as! [String:Any]
524
- print(accuraConfigs1)
525
583
  let face1 = AccurascanKyc.getImageFromUri(path: accuraConfigs1["face1"] as! String)
526
584
  let face2 = AccurascanKyc.getImageFromUri(path: accuraConfigs1["face2"] as! String)
527
585
  lvfm.face1 = face1
@@ -556,7 +614,6 @@ class AccurascanKyc: NSObject {
556
614
 
557
615
  if let theJSONData = try? JSONSerialization.data( withJSONObject: results, options: .prettyPrinted ),
558
616
  let theJSONText = String(data: theJSONData, encoding: .utf8) {
559
- print("JSON string = \n\(theJSONText)")
560
617
  return theJSONText.components(separatedBy: .newlines).joined();
561
618
  }
562
619
  return "{}"
@@ -645,5 +702,47 @@ class NavigationController: UINavigationController {
645
702
  }
646
703
  }
647
704
  }
648
-
705
+ }
706
+
707
+ extension NSDictionary {
708
+
709
+ public static func + (lhs: NSDictionary, rhs: NSDictionary) -> NSDictionary {
710
+ let dictionary = NSMutableDictionary()
711
+ for (key, value) in lhs {
712
+ if let key = key as? NSCopying {
713
+ dictionary[key] = value
714
+ }
715
+ }
716
+ for (key, valueR) in rhs {
717
+ if let key = key as? NSCopying {
718
+ if let valueL = lhs[key] {
719
+ switch (valueL, valueR) {
720
+ case (let dictionaryL as NSDictionary, let dictionaryR as NSDictionary):
721
+ dictionary[key] = dictionaryL + dictionaryR
722
+ break
723
+ case (let arrayL as NSArray, let arrayR as NSArray):
724
+ dictionary[key] = arrayL + arrayR
725
+ default:
726
+ dictionary[key] = valueR
727
+ }
728
+ }
729
+ else {
730
+ dictionary[key] = valueR
731
+ }
732
+ }
733
+ }
734
+ return dictionary
735
+ }
736
+
737
+ }
738
+
739
+ extension NSArray {
740
+
741
+ public static func + (lhs: NSArray, rhs: NSArray) -> NSArray {
742
+ let array = NSMutableArray()
743
+ lhs.forEach { array.add($0) }
744
+ rhs.forEach { array.add($0) }
745
+ return array
746
+ }
747
+
649
748
  }
@@ -3,7 +3,6 @@ import AccuraOCR
3
3
  import Photos
4
4
  import PhotosUI
5
5
  import SVProgressHUD
6
- //import AccuraLiveness_fm
7
6
 
8
7
  //View controller for face match.
9
8
  class FMController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate,PHPickerViewControllerDelegate, UIAdaptivePresentationControllerDelegate {
@@ -1,6 +1,5 @@
1
1
  import UIKit
2
2
  import AccuraOCR
3
- //import AccuraLiveness_fm
4
3
 
5
4
  class LVController: UIViewController,LivenessData,FacematchData
6
5
  {
@@ -39,7 +38,7 @@ class LVController: UIViewController,LivenessData,FacematchData
39
38
  liveness.setFeedbackBackGroundColor(livenessConfig["feedbackBackGroundColor"] as! String)
40
39
  liveness.setFeedbackTextColor(livenessConfig["feedbackTextColor"] as! String)
41
40
  if livenessConfig["setLivenessURL"] != nil {
42
- print("\(livenessConfig["setLivenessURL"])")
41
+ // print("\(livenessConfig["setLivenessURL"])")
43
42
  liveness.setLivenessURL(livenessConfig["setLivenessURL"] as! String)
44
43
  }
45
44
  if livenessConfig["setFeedbackTextSize"] != nil {
@@ -291,7 +290,7 @@ class LVController: UIViewController,LivenessData,FacematchData
291
290
  results["face_score"] = twoDecimalPlaces
292
291
  faceImage = nil
293
292
  self.callBack!([NSNull(),AccurascanKyc.convertJSONString(results:results)])
294
- print(twoDecimalPlaces)
293
+ // print(twoDecimalPlaces)
295
294
  EngineWrapper.faceEngineClose()
296
295
  closeMe()
297
296
  }
@@ -320,7 +319,7 @@ class LVController: UIViewController,LivenessData,FacematchData
320
319
  isfacematch = false
321
320
  var results:[String: Any] = [:]
322
321
  // self.faceRegion = EngineWrapper.detectSourceFaces(self.faceImage)
323
- print(faceRegion as Any)
322
+ // print(faceRegion as Any)
324
323
  if (faceRegion != nil)
325
324
  {
326
325
  let face2 = EngineWrapper.detectTargetFaces(FaceImage, feature1: faceRegion?.feature)
@@ -334,7 +333,7 @@ class LVController: UIViewController,LivenessData,FacematchData
334
333
  results["score"] = "\(twoDecimalPlaces)"
335
334
  self.callBack!([NSNull(),AccurascanKyc.convertJSONString(results:results)])
336
335
  EngineWrapper.faceEngineClose()
337
- print(twoDecimalPlaces)
336
+ // print(twoDecimalPlaces)
338
337
  closeMe()
339
338
  }
340
339
  }else{
@@ -5,6 +5,7 @@
5
5
  <deployment identifier="iOS"/>
6
6
  <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
7
7
  <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8
+ <capability name="System colors in document resources" minToolsVersion="11.0"/>
8
9
  <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
10
  </dependencies>
10
11
  <customFonts key="customFonts">
@@ -210,6 +211,38 @@
210
211
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H7Y-tl-KUI">
211
212
  <rect key="frame" x="98" y="348" width="218" height="210"/>
212
213
  <subviews>
214
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ft8-XZ-k07">
215
+ <rect key="frame" x="0.0" y="0.0" width="55" height="55"/>
216
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
217
+ <constraints>
218
+ <constraint firstAttribute="width" constant="55" id="pDj-TC-p5a"/>
219
+ <constraint firstAttribute="height" constant="55" id="uox-vd-NSg"/>
220
+ </constraints>
221
+ </view>
222
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="75a-lH-nuh">
223
+ <rect key="frame" x="163" y="0.0" width="55" height="55"/>
224
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
225
+ <constraints>
226
+ <constraint firstAttribute="width" constant="55" id="ZAr-UL-lwf"/>
227
+ <constraint firstAttribute="height" constant="55" id="zfb-Qx-F3y"/>
228
+ </constraints>
229
+ </view>
230
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9A9-WL-GZP">
231
+ <rect key="frame" x="0.0" y="155" width="55" height="55"/>
232
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
233
+ <constraints>
234
+ <constraint firstAttribute="height" constant="55" id="afE-2h-YyU"/>
235
+ <constraint firstAttribute="width" constant="55" id="lX2-05-ced"/>
236
+ </constraints>
237
+ </view>
238
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Rkd-Wo-iBd">
239
+ <rect key="frame" x="163" y="155" width="55" height="55"/>
240
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
241
+ <constraints>
242
+ <constraint firstAttribute="width" constant="55" id="7V4-jl-0Ht"/>
243
+ <constraint firstAttribute="height" constant="55" id="QVp-bX-QfC"/>
244
+ </constraints>
245
+ </view>
213
246
  <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="2WA-m0-Xrd">
214
247
  <rect key="frame" x="0.0" y="0.0" width="218" height="210"/>
215
248
  </imageView>
@@ -218,10 +251,18 @@
218
251
  <constraints>
219
252
  <constraint firstAttribute="height" constant="210" id="9X2-DT-LwC"/>
220
253
  <constraint firstItem="2WA-m0-Xrd" firstAttribute="leading" secondItem="H7Y-tl-KUI" secondAttribute="leading" id="FFk-9s-3r2"/>
254
+ <constraint firstItem="75a-lH-nuh" firstAttribute="top" secondItem="H7Y-tl-KUI" secondAttribute="top" id="GDa-FZ-45C"/>
221
255
  <constraint firstItem="2WA-m0-Xrd" firstAttribute="top" secondItem="H7Y-tl-KUI" secondAttribute="top" id="NgY-ER-VlZ"/>
256
+ <constraint firstAttribute="bottom" secondItem="Rkd-Wo-iBd" secondAttribute="bottom" id="RsD-fC-0mR"/>
222
257
  <constraint firstAttribute="width" constant="217.66999999999999" id="S6e-SV-lEV"/>
258
+ <constraint firstItem="9A9-WL-GZP" firstAttribute="leading" secondItem="H7Y-tl-KUI" secondAttribute="leading" id="T0q-jf-Hel"/>
259
+ <constraint firstItem="ft8-XZ-k07" firstAttribute="top" secondItem="H7Y-tl-KUI" secondAttribute="top" id="T4A-ss-vhB"/>
260
+ <constraint firstAttribute="bottom" secondItem="9A9-WL-GZP" secondAttribute="bottom" id="XRr-3H-xks"/>
223
261
  <constraint firstAttribute="bottom" secondItem="2WA-m0-Xrd" secondAttribute="bottom" id="eDW-ew-grb"/>
262
+ <constraint firstItem="ft8-XZ-k07" firstAttribute="leading" secondItem="H7Y-tl-KUI" secondAttribute="leading" id="k3l-48-acg"/>
224
263
  <constraint firstAttribute="trailing" secondItem="2WA-m0-Xrd" secondAttribute="trailing" id="rk8-5s-bWO"/>
264
+ <constraint firstAttribute="trailing" secondItem="Rkd-Wo-iBd" secondAttribute="trailing" id="uqk-5d-spk"/>
265
+ <constraint firstAttribute="trailing" secondItem="75a-lH-nuh" secondAttribute="trailing" id="wOx-wH-pAV"/>
225
266
  </constraints>
226
267
  </view>
227
268
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="imw-Ji-jxI">
@@ -316,6 +357,10 @@
316
357
  <outlet property="cameraView2" destination="Xeq-2P-V46" id="ZwX-kd-kzL"/>
317
358
  <outlet property="cameraView3" destination="ydb-cP-iYb" id="HZV-Eq-FTM"/>
318
359
  <outlet property="cameraView4" destination="RFq-ho-TYb" id="NgD-fY-BQT"/>
360
+ <outlet property="cvlb" destination="9A9-WL-GZP" id="fbd-PB-mdC"/>
361
+ <outlet property="cvlt" destination="ft8-XZ-k07" id="GUj-tc-ruQ"/>
362
+ <outlet property="cvrb" destination="Rkd-Wo-iBd" id="LJ8-Rg-28L"/>
363
+ <outlet property="cvrt" destination="75a-lH-nuh" id="FMH-gZ-3z9"/>
319
364
  <outlet property="lblOCRMsg" destination="siT-lO-al7" id="0Vs-Pi-GbA"/>
320
365
  <outlet property="lblTitleCountryName" destination="KvH-IU-FZJ" id="pzk-Uv-aNK"/>
321
366
  <outlet property="logoView" destination="imw-Ji-jxI" id="Ry5-rO-mae"/>
@@ -334,5 +379,8 @@
334
379
  <image name="flip_camera_icon.png" width="100" height="100"/>
335
380
  <image name="flip_document_icon.png" width="768" height="768"/>
336
381
  <image name="ic_logo.png" width="610.28570556640625" height="305.14285278320312"/>
382
+ <systemColor name="systemBackgroundColor">
383
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
384
+ </systemColor>
337
385
  </resources>
338
386
  </document>
@@ -33,6 +33,12 @@ class ViewController: UIViewController {
33
33
  @IBOutlet weak var backBtn: UIButton!
34
34
  @IBOutlet weak var camFlpbtnLbl: UIButton!
35
35
 
36
+
37
+ @IBOutlet weak var cvlt: UIView!
38
+ @IBOutlet weak var cvrt: UIView!
39
+ @IBOutlet weak var cvlb: UIView!
40
+ @IBOutlet weak var cvrb: UIView!
41
+
36
42
  var accuraErrorCode:NSDictionary = [:]
37
43
  var accuraTitleMsg:NSDictionary = [:]
38
44
  var isBarcodeEnabled: Bool = false
@@ -120,6 +126,21 @@ class ViewController: UIViewController {
120
126
  super.viewDidLoad()
121
127
  topView.backgroundColor = .clear
122
128
 
129
+ cvlt.backgroundColor = .clear
130
+ cvlb.backgroundColor = .clear
131
+ cvrt.backgroundColor = .clear
132
+ cvrb.backgroundColor = .clear
133
+ if accuraErrorCode["flipImage"] as! String != "" {
134
+ if let url = URL(string: accuraErrorCode["flipImage"] as! String) {
135
+ do {
136
+ let data = try Data(contentsOf: url)
137
+ let image = UIImage(data: data)
138
+ _imgFlipView.image = image
139
+ } catch {
140
+ print("Error loading image: \(error.localizedDescription)")
141
+ }
142
+ }
143
+ }
123
144
  // let viewController = UIApplication.shared.delegate?.window??.rootViewController
124
145
  // viewController?.present(self, animated: true, completion: nil)
125
146
  // Do any additional setup after loading the view.
@@ -201,13 +222,35 @@ class ViewController: UIViewController {
201
222
  // if ((accuraErrorCode["setCameraFrame"] as! String) != "") {
202
223
  // cameraFrame.image = frameImg
203
224
  // }else{
204
- if ((accuraErrorCode["CameraScreen_Frame_Color"] as! String) == "") {
205
- _viewLayer.layer.borderColor = UIColor.white.cgColor
206
- _viewLayer.layer.borderWidth = 3.0
225
+ let isBorder = (accuraErrorCode["CameraScreen_CornerBorder_Enable"]) as! Bool
226
+ let borderWidth = (accuraErrorCode["CameraScreen_Border_Width"] as! Int)/5
227
+ if(isBorder){
228
+
229
+ let borderColor = UIColor(hexString: accuraErrorCode["CameraScreen_Frame_Color"] as! String)
230
+
231
+
232
+ cvlt.addTopBorder(with: borderColor, andWidth: CGFloat(borderWidth))
233
+ cvlt.addLeftBorder(with: borderColor, andWidth: CGFloat(borderWidth))
234
+
235
+ cvlb.addLeftBorder(with: borderColor, andWidth: CGFloat(borderWidth))
236
+ cvlb.addBottomBorder(with: borderColor, andWidth: CGFloat(borderWidth))
237
+
238
+ cvrt.addRightBorder(with: borderColor, andWidth: CGFloat(borderWidth))
239
+ cvrt.addTopBorder(with: borderColor, andWidth: CGFloat(borderWidth))
240
+
241
+ cvrb.addBottomBorder(with: borderColor, andWidth: CGFloat(borderWidth))
242
+ cvrb.addRightBorder(with: borderColor, andWidth: CGFloat(borderWidth))
243
+
244
+ _viewLayer.layer.borderColor = UIColor.clear.cgColor
207
245
  }else{
246
+ if ((accuraErrorCode["CameraScreen_Frame_Color"] as! String) == "") {
247
+ _viewLayer.layer.borderColor = UIColor.white.cgColor
248
+ _viewLayer.layer.borderWidth = CGFloat(borderWidth)
249
+ }else{
208
250
  _viewLayer.layer.borderColor = UIColor(hexString: accuraErrorCode["CameraScreen_Frame_Color"] as! String).cgColor
209
- _viewLayer.layer.borderWidth = 3.0
251
+ _viewLayer.layer.borderWidth = CGFloat(borderWidth)
210
252
  }
253
+ }
211
254
  // }
212
255
  // _viewLayer.layer.borderColor = UIColor(hexString: accuraErrorCode["CameraScreen_Frame_Color"] as! String).cgColor
213
256
  // _viewLayer.layer.borderWidth = 3.0
@@ -1756,9 +1799,9 @@ extension ViewController: VideoCameraWrapperDelegate {
1756
1799
  self.viewNavigationBar.backgroundColor = .clear
1757
1800
  height = (((UIScreen.main.bounds.size.height - 100) * 5) / 5.6)
1758
1801
  width = (height / CGFloat(borderRatio))
1759
- print("boreder ratio :- ", borderRatio)
1802
+ // print("boreder ratio :- ", borderRatio)
1760
1803
  }
1761
- print("layer", width)
1804
+ // print("layer", width)
1762
1805
  DispatchQueue.main.async {
1763
1806
  self._constant_width.constant = width
1764
1807
 
@@ -2150,8 +2193,16 @@ extension ViewController: VideoCameraWrapperDelegate {
2150
2193
  shareScanningListing["fontImageRotation"] = frontImageRotation
2151
2194
  shareScanningListing["backImageRotation"] = backImageRotation
2152
2195
  var mrzData:[String: String] = [:]
2153
- if let frontUri = AccurascanKyc.getImageUri(img: photoImage, name: nil){
2154
- results["face"] = frontUri
2196
+ // if let frontUri = AccurascanKyc.getImageUri(img: photoImage, name: nil){
2197
+ // results["face"] = frontUri
2198
+ // }
2199
+ if let image_photoImage: Data = shareScanningListing["photoImage"] as? Data {
2200
+ let pHotoImage = UIImage(data: image_photoImage)
2201
+ if (pHotoImage != nil){
2202
+ if let frontUri = AccurascanKyc.getImageUri(img: pHotoImage!, name: nil){
2203
+ results["face"] = frontUri
2204
+ }
2205
+ }
2155
2206
  }
2156
2207
  let kK = shareScanningListing.allKeys
2157
2208
  let vV = shareScanningListing.allValues
@@ -2166,7 +2217,7 @@ extension ViewController: VideoCameraWrapperDelegate {
2166
2217
  }
2167
2218
  }
2168
2219
  }
2169
- print("\(shareScanningListing)")
2220
+ // print("\(shareScanningListing)")
2170
2221
  mrzData = getMRZKeyValue()
2171
2222
  // mrzData = dD as! [String : String]//self.getMRZKeyValue()
2172
2223
  results["mrz_data"] = mrzData
@@ -2478,7 +2529,7 @@ extension ViewController: VideoCameraWrapperDelegate {
2478
2529
 
2479
2530
  func getMRZKeyValue() -> [String: String] {
2480
2531
  var mrzData:[String: String] = [:]
2481
- print("\(shareScanningListing)")
2532
+ // print("\(shareScanningListing)")
2482
2533
  if let line = shareScanningListing["lines"] as? String {
2483
2534
  mrzData["MRZ"] = line
2484
2535
 
@@ -2684,3 +2735,39 @@ extension UIColor {
2684
2735
 
2685
2736
  }
2686
2737
 
2738
+ extension UIView {
2739
+
2740
+ func addTopBorder(with color: UIColor?, andWidth borderWidth: CGFloat) {
2741
+ let border = UIView()
2742
+ border.backgroundColor = color
2743
+ border.autoresizingMask = [.flexibleWidth, .flexibleBottomMargin]
2744
+ border.frame = CGRect(x: 0, y: 0, width: frame.size.width, height: borderWidth)
2745
+ addSubview(border)
2746
+ }
2747
+
2748
+ func addBottomBorder(with color: UIColor?, andWidth borderWidth: CGFloat) {
2749
+ let border = UIView()
2750
+ border.backgroundColor = color
2751
+ border.autoresizingMask = [.flexibleWidth, .flexibleTopMargin]
2752
+ border.frame = CGRect(x: 0, y: frame.size.height - borderWidth, width: frame.size.width, height: borderWidth)
2753
+ addSubview(border)
2754
+ }
2755
+
2756
+ func addLeftBorder(with color: UIColor?, andWidth borderWidth: CGFloat) {
2757
+ let border = UIView()
2758
+ border.backgroundColor = color
2759
+ border.frame = CGRect(x: 0, y: 0, width: borderWidth, height: frame.size.height)
2760
+ border.autoresizingMask = [.flexibleHeight, .flexibleRightMargin]
2761
+ addSubview(border)
2762
+ }
2763
+
2764
+ func addRightBorder(with color: UIColor?, andWidth borderWidth: CGFloat) {
2765
+ let border = UIView()
2766
+ border.backgroundColor = color
2767
+ border.autoresizingMask = [.flexibleHeight, .flexibleLeftMargin]
2768
+ border.frame = CGRect(x: frame.size.width - borderWidth, y: 0, width: borderWidth, height: frame.size.height)
2769
+ addSubview(border)
2770
+ }
2771
+
2772
+ }
2773
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurascan_kyc",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -157,5 +157,8 @@
157
157
  }
158
158
  ]
159
159
  ]
160
+ },
161
+ "dependencies": {
162
+ "@react-native-material/core": "^1.3.7"
160
163
  }
161
164
  }
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- </Workspace>