accurascan_kyc 1.2.4-KYC → 1.2.5-Sim

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.
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
22
22
  s.dependency "React-Core"
23
23
  s.static_framework = true
24
24
  # s.dependency "AccuraKYC","4.0.2"
25
- s.dependency "AccuraKYC_Sim","4.0.4"
25
+ s.dependency "AccuraKYC_Sim","4.0.5"
26
26
  # Don't install the dependencies when we run `pod install` in the old architecture.
27
27
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28
28
  s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
@@ -150,9 +150,9 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
150
150
  JSONArray countries = new JSONArray();
151
151
  for (int i = 0; i < modelList.size(); i++) {
152
152
  JSONObject country = new JSONObject();
153
- if (Objects.equals(modelList.get(i).getCountry_name(), "Saint Kitts and Nevis")) {
154
- results.put("isSchengen", true);
155
- } else {
153
+ // if (Objects.equals(modelList.get(i).getCountry_name(), "Saint Kitts and Nevis")) {
154
+ // results.put("isSchengen", true);
155
+ // } else {
156
156
  country.put("name", modelList.get(i).getCountry_name());
157
157
  country.put("id", modelList.get(i).getCountry_id());
158
158
  JSONArray cards = new JSONArray();
@@ -166,7 +166,7 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
166
166
  }
167
167
  country.put("cards", cards);
168
168
  countries.put(country);
169
- }
169
+ // }
170
170
  }
171
171
  results.put("countries", countries);
172
172
  }
@@ -224,8 +224,18 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
224
224
  actualAccuraErrorConfg.put("isShowLogo",1);
225
225
  actualAccuraErrorConfg.put("isFlipImg",1);
226
226
  actualAccuraErrorConfg.put("CameraScreen_Frame_Color","#D5323F");
227
- actualAccuraErrorConfg.put("CameraScreen_Text_Color","#FFFFFF");
228
- actualAccuraErrorConfg.put("CameraScreen_Text_Border_Color","#000000");
227
+
228
+ actualAccuraErrorConfg.put("fontStyle","");
229
+ actualAccuraErrorConfg.put("fontName","");
230
+ actualAccuraErrorConfg.put("CameraScreen_Heading_Text_Size",16);
231
+ actualAccuraErrorConfg.put("CameraScreen_Heading_Text_Color","#FFFFFF");
232
+ actualAccuraErrorConfg.put("CameraScreen_Error_Text_Color","#FFFFFF");
233
+ actualAccuraErrorConfg.put("CameraScreen_Error_Text_Size",16);
234
+ actualAccuraErrorConfg.put("CameraScreen_Heading_Text_Border_Color","#000000");
235
+ actualAccuraErrorConfg.put("CameraScreen_Error_Text_Border_Color","#000000");
236
+ actualAccuraErrorConfg.put("CameraScreen_Flip_Image_Height",80);
237
+ actualAccuraErrorConfg.put("CameraScreen_Flip_Image_Width",80);
238
+
229
239
  actualAccuraErrorConfg.put("CameraScreen_Color","#80000000");
230
240
  actualAccuraErrorConfg.put("CameraScreen_Border_Width",10);
231
241
  actualAccuraErrorConfg.put("CameraScreen_CornerBorder_Enable",false);
@@ -289,6 +299,10 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
289
299
  accuraTitleMsg.put(key, args.getJSONObject(2).get(key));
290
300
  }
291
301
 
302
+ System.out.println("jhhjhjhjhjhjhjhj");
303
+ System.out.println(accuraErrorConfg.getString("fontStyle"));
304
+
305
+ System.out.println(accuraErrorConfg.getString("flipImage"));
292
306
 
293
307
  OcrActivity.accuraErrorConfg = accuraErrorConfg;
294
308
  OcrActivity.accuraTitleMsg = accuraTitleMsg;
@@ -440,28 +454,28 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
440
454
 
441
455
  String mrzType = args.getString(0);
442
456
 
443
- if (mrzType.equals("schengen_visa")){
444
-
445
- onResult = callbackContext;
446
- OcrActivity.accuraErrorConfg = accuraErrorConfg;
447
- OcrActivity.accuraTitleMsg = accuraTitleMsg;
448
-
449
- int countryId = 159;
450
- int cardId = 676;
451
- String cardSelected = "Schengen Visa";
452
- int cardType = 0;
453
-
454
- Intent intent = new Intent(getCurrentActivity(),OcrActivity.class);
455
- intent.putExtra("country_id",countryId);
456
- intent.putExtra("card_id",cardId);
457
- intent.putExtra("card_name",cardSelected);
458
-
459
- RecogType.OCR.attachTo(intent);
460
- OcrActivity.recogType = RecogType.OCR;
461
-
462
- Objects.requireNonNull(getCurrentActivity()).startActivity(intent);
463
- return true;
464
- }else {
457
+ // if (mrzType.equals("schengen_visa")){
458
+ //
459
+ // onResult = callbackContext;
460
+ // OcrActivity.accuraErrorConfg = accuraErrorConfg;
461
+ // OcrActivity.accuraTitleMsg = accuraTitleMsg;
462
+ //
463
+ // int countryId = 159;
464
+ // int cardId = 676;
465
+ // String cardSelected = "Schengen Visa";
466
+ // int cardType = 0;
467
+ //
468
+ // Intent intent = new Intent(getCurrentActivity(),OcrActivity.class);
469
+ // intent.putExtra("country_id",countryId);
470
+ // intent.putExtra("card_id",cardId);
471
+ // intent.putExtra("card_name",cardSelected);
472
+ //
473
+ // RecogType.OCR.attachTo(intent);
474
+ // OcrActivity.recogType = RecogType.OCR;
475
+ //
476
+ // Objects.requireNonNull(getCurrentActivity()).startActivity(intent);
477
+ // return true;
478
+ // }else {
465
479
  Intent intent = new Intent(getCurrentActivity(),OcrActivity.class);
466
480
  RecogType.MRZ.attachTo(intent);
467
481
  OcrActivity.recogType = RecogType.MRZ;
@@ -481,7 +495,7 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
481
495
  onResult = callbackContext;
482
496
  getCurrentActivity().startActivity(intent);
483
497
  return true;
484
- }
498
+ // }
485
499
  }
486
500
 
487
501
  @ReactMethod
@@ -0,0 +1,56 @@
1
+ package com.accurascankyc;
2
+
3
+ import android.graphics.Typeface;
4
+ import android.os.AsyncTask;
5
+ import android.widget.TextView;
6
+
7
+ import java.io.File;
8
+ import java.io.FileOutputStream;
9
+ import java.io.InputStream;
10
+ import java.net.HttpURLConnection;
11
+ import java.net.URL;
12
+
13
+ public class DownloadFontTask extends AsyncTask<String, Void, File> {
14
+
15
+ private TextView textView;
16
+
17
+ public DownloadFontTask(TextView textView) {
18
+ this.textView = textView;
19
+ }
20
+
21
+ @Override
22
+ protected File doInBackground(String... urls) {
23
+ String urlString = urls[0];
24
+ File fontFile = null;
25
+ try {
26
+ URL url = new URL(urlString);
27
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
28
+ connection.setRequestMethod("GET");
29
+ connection.connect();
30
+
31
+ InputStream inputStream = connection.getInputStream();
32
+ fontFile = new File(textView.getContext().getCacheDir(), "custom_font.ttf");
33
+
34
+ FileOutputStream outputStream = new FileOutputStream(fontFile);
35
+ byte[] buffer = new byte[1024];
36
+ int length;
37
+ while ((length = inputStream.read(buffer)) > 0) {
38
+ outputStream.write(buffer, 0, length);
39
+ }
40
+ outputStream.close();
41
+ inputStream.close();
42
+ } catch (Exception e) {
43
+ e.printStackTrace();
44
+ }
45
+ return fontFile;
46
+ }
47
+
48
+ @Override
49
+ protected void onPostExecute(File fontFile) {
50
+ if (fontFile != null && textView != null) {
51
+ Typeface typeface = Typeface.createFromFile(fontFile);
52
+ textView.setTypeface(typeface);
53
+ }
54
+ }
55
+ }
56
+
@@ -66,7 +66,8 @@ import javax.net.ssl.TrustManager;
66
66
  import javax.net.ssl.X509TrustManager;
67
67
 
68
68
  import okhttp3.OkHttpClient;
69
-
69
+ import android.view.ViewGroup.LayoutParams;
70
+ import android.graphics.Typeface;
70
71
 
71
72
  public class OcrActivity extends SensorsActivity implements OcrCallback {
72
73
 
@@ -259,15 +260,24 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
259
260
  });
260
261
 
261
262
  try {
262
- if (accuraErrorConfg.has("CameraScreen_Label_Text_Size")){
263
- tvTitle.setTextSize(accuraErrorConfg.getInt("CameraScreen_Label_Text_Size"));
264
- tvScanMessage.setTextSize(accuraErrorConfg.getInt("CameraScreen_Label_Text_Size"));
263
+ if (accuraErrorConfg.has("CameraScreen_Heading_Text_Size")){
264
+ tvTitle.setTextSize(accuraErrorConfg.getInt("CameraScreen_Heading_Text_Size"));
265
+ }else{
266
+ }
267
+ } catch (JSONException e) {
268
+ e.printStackTrace();
269
+ }
270
+
271
+ try {
272
+ if (accuraErrorConfg.has("CameraScreen_Error_Text_Size")){
273
+ tvScanMessage.setTextSize(accuraErrorConfg.getInt("CameraScreen_Error_Text_Size"));
265
274
  }else{
266
275
  }
267
276
  } catch (JSONException e) {
268
277
  e.printStackTrace();
269
278
  }
270
279
 
280
+
271
281
  try {
272
282
  borderFrame.setBorderColor(Color.parseColor(accuraErrorConfg.getString("CameraScreen_Frame_Color")));
273
283
  borderFrame.setBorderWidth(accuraErrorConfg.getInt("CameraScreen_Border_Width"));
@@ -305,6 +315,18 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
305
315
  e.printStackTrace();
306
316
  }
307
317
 
318
+ String fontUrl = null;
319
+ try {
320
+ fontUrl = accuraErrorConfg.getString("fontStyle");
321
+ } catch (JSONException e) {
322
+ throw new RuntimeException(e);
323
+ }
324
+ if(!fontUrl.equals("")){
325
+ new DownloadFontTask(tvTitle).execute(fontUrl);
326
+ new DownloadFontTask(tvScanMessage).execute(fontUrl);
327
+ }
328
+
329
+
308
330
  viewLeft.setBackgroundColor(Color.parseColor(screenColor));
309
331
  viewRight.setBackgroundColor(Color.parseColor(screenColor));
310
332
  viewTop.setBackgroundColor(Color.parseColor(screenColor));
@@ -329,33 +351,60 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
329
351
  // drawable.setCornerRadius(dp2Px(borderCornerRadius));
330
352
 
331
353
  String titleTextColor = "#ffffff";
332
- String messageTextColor = "#ff0000";
333
-
354
+ String errorTextColor = "#ffffff";
355
+ String messageTTextColor = "#ff0000";
356
+ String messageETextColor = "#ff0000";
334
357
  try {
335
- if (accuraErrorConfg.getString("CameraScreen_Text_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Text_Color")){
358
+ if (accuraErrorConfg.getString("CameraScreen_Heading_Text_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Heading_Text_Color")){
336
359
  titleTextColor = "#ffffff";
337
360
  }else{
338
- titleTextColor = accuraErrorConfg.getString("CameraScreen_Text_Color");
361
+ titleTextColor = accuraErrorConfg.getString("CameraScreen_Heading_Text_Color");
339
362
  }
340
363
  } catch (JSONException e) {
341
364
  e.printStackTrace();
342
365
  }
343
366
 
344
367
  try {
345
- if (accuraErrorConfg.getString("CameraScreen_Text_Border_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Text_Border_Color")){
346
- messageTextColor = "#00000000";
368
+ if (accuraErrorConfg.getString("CameraScreen_Error_Text_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Error_Text_Color")){
369
+ errorTextColor = "#ffffff";
347
370
  }else{
348
- messageTextColor = accuraErrorConfg.getString("CameraScreen_Text_Border_Color");
371
+ errorTextColor = accuraErrorConfg.getString("CameraScreen_Error_Text_Color");
349
372
  }
350
373
  } catch (JSONException e) {
351
374
  e.printStackTrace();
352
375
  }
353
376
 
377
+ try {
378
+ if (accuraErrorConfg.getString("CameraScreen_Heading_Text_Border_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Heading_Text_Border_Color")){
379
+ messageTTextColor = "#00000000";
380
+ }else{
381
+ messageTTextColor = accuraErrorConfg.getString("CameraScreen_Heading_Text_Border_Color");
382
+ }
383
+ } catch (JSONException e) {
384
+ e.printStackTrace();
385
+ }
386
+
387
+ try {
388
+ if (accuraErrorConfg.getString("CameraScreen_Error_Text_Border_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Error_Text_Border_Color")){
389
+ messageETextColor = "#00000000";
390
+ }else{
391
+ messageETextColor = accuraErrorConfg.getString("CameraScreen_Error_Text_Border_Color");
392
+ }
393
+ } catch (JSONException e) {
394
+ e.printStackTrace();
395
+ }
396
+
397
+ try {
398
+ setImageViewSize(imageFlip,accuraErrorConfg.getInt("CameraScreen_Flip_Image_Width"),accuraErrorConfg.getInt("CameraScreen_Flip_Image_Height"));
399
+ } catch (JSONException e) {
400
+ throw new RuntimeException(e);
401
+ }
402
+
354
403
  tvTitle.setTextColor(Color.parseColor(titleTextColor));
355
- tvTitle.setStroke(2, Color.parseColor(messageTextColor), Paint.Join.BEVEL, 10);
404
+ tvTitle.setStroke(2, Color.parseColor(messageTTextColor), Paint.Join.BEVEL, 10);
356
405
 
357
- tvScanMessage.setTextColor(Color.parseColor(titleTextColor));
358
- tvScanMessage.setStroke(2, Color.parseColor(messageTextColor), Paint.Join.ROUND, 10);
406
+ tvScanMessage.setTextColor(Color.parseColor(errorTextColor));
407
+ tvScanMessage.setStroke(2, Color.parseColor(messageETextColor), Paint.Join.ROUND, 10);
359
408
 
360
409
 
361
410
  }
@@ -428,6 +477,12 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
428
477
  //</editor-fold>
429
478
  }
430
479
 
480
+ private void setImageViewSize(ImageView imageView, int width, int height) {
481
+ LayoutParams params = imageView.getLayoutParams();
482
+ params.width = width;
483
+ params.height = height;
484
+ imageView.setLayoutParams(params);
485
+ }
431
486
  /**
432
487
  * Override this method after scan complete to get data from document
433
488
  *
@@ -99,7 +99,7 @@
99
99
 
100
100
  <ImageView
101
101
  android:id="@+id/im_flip_image"
102
- android:layout_width="100dp"
102
+ android:layout_width="wrap_content"
103
103
  android:layout_height="wrap_content"
104
104
  android:layout_centerInParent="true"
105
105
  android:contentDescription="@string/app_name"
@@ -99,7 +99,7 @@
99
99
 
100
100
  <ImageView
101
101
  android:id="@+id/im_flip_image"
102
- android:layout_width="100dp"
102
+ android:layout_width="wrap_content"
103
103
  android:layout_height="wrap_content"
104
104
  android:layout_centerInParent="true"
105
105
  android:contentDescription="@string/app_name"
@@ -43,8 +43,18 @@ class AccurascanKyc: NSObject {
43
43
  "CameraScreen_CornerBorder_Enable":false,
44
44
  "CameraScreen_Border_Width":10,
45
45
  "CameraScreen_Frame_Color": "#D5323F",
46
- "CameraScreen_Text_Color": "#FFFFFF",
47
- "CameraScreen_Text_Border_Color": "#000000",
46
+
47
+ "fontStyle": "",
48
+ "fontName":"",
49
+ "CameraScreen_Heading_Text_Size": 16,
50
+ "CameraScreen_Heading_Text_Color": "#FFFFFF",
51
+ "CameraScreen_Error_Text_Color": "#FFFFFF",
52
+ "CameraScreen_Error_Text_Size": 16,
53
+ "CameraScreen_Heading_Text_Border_Color": "#000000",
54
+ "CameraScreen_Error_Text_Border_Color": "#000000",
55
+ "CameraScreen_Flip_Image_Height":80,
56
+ "CameraScreen_Flip_Image_Width":80,
57
+
48
58
  "CameraScreen_Color": "#80000000",
49
59
  "CameraScreen_Back_Button": 1,
50
60
  "CameraScreen_Change_Button": 1,
@@ -148,9 +158,9 @@ class AccurascanKyc: NSObject {
148
158
  for item in countryListStr ?? [] {
149
159
  let cntry = item as! NSDictionary
150
160
  var country:[String: Any] = [:]
151
- if cntry.value(forKey: "country_name") as? String == "Saint Kitts and Nevis" {
152
- results["isSchengen"] = true
153
- }else{
161
+ // if cntry.value(forKey: "country_name") as? String == "Saint Kitts and Nevis" {
162
+ // results["isSchengen"] = true
163
+ // }else{
154
164
  country["name"] = cntry.value(forKey: "country_name")
155
165
  country["id"] = cntry.value(forKey: "country_id")
156
166
  var cards:[[String: Any]] = []
@@ -164,7 +174,7 @@ class AccurascanKyc: NSObject {
164
174
  }
165
175
  country["cards"] = cards
166
176
  countries.append(country)
167
- }
177
+ // }
168
178
  }
169
179
  results["countries"] = countries
170
180
  if sdkModel!.isBarcodeEnable {
@@ -335,25 +345,25 @@ class AccurascanKyc: NSObject {
335
345
  lvfm.faceImage = nil
336
346
  self.goNativeCallBack = callback;
337
347
  self.goNativeArgs = argsNew;
338
- if self.goNativeArgs[0] as! String == "schengen_visa" {
339
- DispatchQueue.main.async {
340
- self.goNativeCallBack = callback;
341
- self.goNativeArgs = argsNew;
342
- let viewController = UIStoryboard(name: "MainStoryboard_iPhone", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
343
- viewController.countryid = 159
344
- viewController.cardid = 676
345
- viewController.isCheckScanOCR = true
346
-
347
- viewController.cardType = 0
348
- viewController.docName = "Schengen Visa"
349
- viewController.callBack = self.goNativeCallBack
350
- viewController.accuraTitleMsg = self.accuraTitleMsg
351
- viewController.accuraErrorCode = self.accuraconfigs
352
- viewController.modalPresentationStyle = .fullScreen
353
- viewController.modalTransitionStyle = .coverVertical
354
- self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
355
- }
356
- }else{
348
+ // if self.goNativeArgs[0] as! String == "schengen_visa" {
349
+ // DispatchQueue.main.async {
350
+ // self.goNativeCallBack = callback;
351
+ // self.goNativeArgs = argsNew;
352
+ // let viewController = UIStoryboard(name: "MainStoryboard_iPhone", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
353
+ // viewController.countryid = 159
354
+ // viewController.cardid = 676
355
+ // viewController.isCheckScanOCR = true
356
+ //
357
+ // viewController.cardType = 0
358
+ // viewController.docName = "Schengen Visa"
359
+ // viewController.callBack = self.goNativeCallBack
360
+ // viewController.accuraTitleMsg = self.accuraTitleMsg
361
+ // viewController.accuraErrorCode = self.accuraconfigs
362
+ // viewController.modalPresentationStyle = .fullScreen
363
+ // viewController.modalTransitionStyle = .coverVertical
364
+ // self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
365
+ // }
366
+ // }else{
357
367
  DispatchQueue.main.async {
358
368
  let viewController = UIStoryboard(name: "MainStoryboard_iPhone", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
359
369
  if self.goNativeArgs[0] as! String == "passport_mrz" {
@@ -376,7 +386,7 @@ class AccurascanKyc: NSObject {
376
386
  // viewController.modalPresentationStyle = .fullScreen
377
387
  self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
378
388
  }
379
- }
389
+ // }
380
390
  }
381
391
 
382
392
  @objc(startFaceMatch:callback:)
@@ -1,9 +1,9 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3
3
  <device id="retina6_1" orientation="portrait" appearance="light"/>
4
4
  <dependencies>
5
5
  <deployment identifier="iOS"/>
6
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
6
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
7
7
  <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8
8
  <capability name="System colors in document resources" minToolsVersion="11.0"/>
9
9
  <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -117,10 +117,10 @@
117
117
  </constraints>
118
118
  </imageView>
119
119
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CiR-dY-2B6">
120
- <rect key="frame" x="0.0" y="0.0" width="414" height="348"/>
120
+ <rect key="frame" x="0.0" y="0.0" width="414" height="350"/>
121
121
  <subviews>
122
122
  <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CNj-BH-U25">
123
- <rect key="frame" x="10" y="326" width="394" height="19"/>
123
+ <rect key="frame" x="10" y="328" width="394" height="19"/>
124
124
  <constraints>
125
125
  <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="19" id="vj3-Pn-h2U"/>
126
126
  </constraints>
@@ -136,11 +136,11 @@
136
136
  </constraints>
137
137
  </view>
138
138
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NT2-gE-6Fu" userLabel="View Satuts bar">
139
- <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
139
+ <rect key="frame" x="0.0" y="0.0" width="414" height="48"/>
140
140
  <color key="backgroundColor" red="0.40392160420000001" green="0.44313728810000003" blue="0.49803921579999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
141
141
  </view>
142
142
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Xp-ZJ-diK" userLabel="View navigation">
143
- <rect key="frame" x="0.0" y="44" width="414" height="60"/>
143
+ <rect key="frame" x="0.0" y="48" width="414" height="60"/>
144
144
  <subviews>
145
145
  <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gTB-4i-B1g">
146
146
  <rect key="frame" x="8" y="10" width="40" height="40"/>
@@ -186,7 +186,7 @@
186
186
  </constraints>
187
187
  </view>
188
188
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RFq-ho-TYb">
189
- <rect key="frame" x="0.0" y="558" width="414" height="338"/>
189
+ <rect key="frame" x="0.0" y="560" width="414" height="336"/>
190
190
  <subviews>
191
191
  <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="siT-lO-al7">
192
192
  <rect key="frame" x="207" y="3" width="0.0" height="19"/>
@@ -205,11 +205,11 @@
205
205
  </constraints>
206
206
  </view>
207
207
  <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ydb-cP-iYb">
208
- <rect key="frame" x="316" y="348" width="98" height="210"/>
208
+ <rect key="frame" x="316" y="350" width="98" height="210"/>
209
209
  <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
210
210
  </view>
211
211
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H7Y-tl-KUI">
212
- <rect key="frame" x="98" y="348" width="218" height="210"/>
212
+ <rect key="frame" x="98" y="350" width="218" height="210"/>
213
213
  <subviews>
214
214
  <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ft8-XZ-k07">
215
215
  <rect key="frame" x="0.0" y="0.0" width="55" height="55"/>
@@ -266,7 +266,7 @@
266
266
  </constraints>
267
267
  </view>
268
268
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="imw-Ji-jxI">
269
- <rect key="frame" x="251" y="513" width="60" height="40"/>
269
+ <rect key="frame" x="251" y="515" width="60" height="40"/>
270
270
  <subviews>
271
271
  <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_logo.png" translatesAutoresizingMaskIntoConstraints="NO" id="l9d-FF-fgU">
272
272
  <rect key="frame" x="0.0" y="0.0" width="60" height="40"/>
@@ -284,14 +284,14 @@
284
284
  </constraints>
285
285
  </view>
286
286
  <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="flip_document_icon.png" translatesAutoresizingMaskIntoConstraints="NO" id="xXf-iS-nXe">
287
- <rect key="frame" x="167" y="413" width="80" height="80"/>
287
+ <rect key="frame" x="167" y="415" width="80" height="80"/>
288
288
  <constraints>
289
289
  <constraint firstAttribute="width" constant="80" id="Y17-vM-kyR"/>
290
290
  <constraint firstAttribute="height" constant="80" id="mBf-nb-APP"/>
291
291
  </constraints>
292
292
  </imageView>
293
293
  <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xeq-2P-V46">
294
- <rect key="frame" x="0.0" y="348" width="98" height="210"/>
294
+ <rect key="frame" x="0.0" y="350" width="98" height="210"/>
295
295
  <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
296
296
  </view>
297
297
  </subviews>
@@ -361,6 +361,8 @@
361
361
  <outlet property="cvlt" destination="ft8-XZ-k07" id="GUj-tc-ruQ"/>
362
362
  <outlet property="cvrb" destination="Rkd-Wo-iBd" id="LJ8-Rg-28L"/>
363
363
  <outlet property="cvrt" destination="75a-lH-nuh" id="FMH-gZ-3z9"/>
364
+ <outlet property="flipImageHeight" destination="mBf-nb-APP" id="CTo-nW-Uhg"/>
365
+ <outlet property="flipImageWidth" destination="Y17-vM-kyR" id="Viv-AF-sli"/>
364
366
  <outlet property="lblOCRMsg" destination="siT-lO-al7" id="0Vs-Pi-GbA"/>
365
367
  <outlet property="lblTitleCountryName" destination="KvH-IU-FZJ" id="pzk-Uv-aNK"/>
366
368
  <outlet property="logoView" destination="imw-Ji-jxI" id="Ry5-rO-mae"/>
@@ -1,7 +1,8 @@
1
-
1
+
2
2
  import UIKit
3
3
  import AVFoundation
4
4
  import AccuraOCR
5
+ import CoreText
5
6
 
6
7
  class ViewController: UIViewController {
7
8
 
@@ -12,6 +13,9 @@ class ViewController: UIViewController {
12
13
  @IBOutlet weak var _constant_height: NSLayoutConstraint!
13
14
  @IBOutlet weak var _constant_width: NSLayoutConstraint!
14
15
 
16
+ @IBOutlet weak var flipImageHeight: NSLayoutConstraint!
17
+ @IBOutlet weak var flipImageWidth: NSLayoutConstraint!
18
+
15
19
  @IBOutlet weak var AspectRatio: NSLayoutConstraint!
16
20
  @IBOutlet weak var lblOCRMsg: UILabel!
17
21
  @IBOutlet weak var lblTitleCountryName: UILabel!
@@ -155,26 +159,61 @@ class ViewController: UIViewController {
155
159
  // Fallback on earlier versions
156
160
  }
157
161
  let strokeTextAttributes: [NSAttributedString.Key : Any] = [
158
- .strokeColor : accuraErrorCode["CameraScreen_Text_Border_Color"] as! String != "" ? UIColor(hexString: accuraErrorCode["CameraScreen_Text_Border_Color"] as! String): UIColor.clear,
159
- .foregroundColor : UIColor(hexString: accuraErrorCode["CameraScreen_Text_Color"] as! String),
162
+ .strokeColor : accuraErrorCode["CameraScreen_Heading_Text_Border_Color"] as! String != "" ? UIColor(hexString: accuraErrorCode["CameraScreen_Heading_Text_Border_Color"] as! String): UIColor.clear,
163
+ .foregroundColor : UIColor(hexString: accuraErrorCode["CameraScreen_Heading_Text_Color"] as! String),
160
164
  .strokeWidth : -3.0,
161
165
  ]
162
166
 
163
- // if(accuraErrorCode["CameraScreen_Text_Color"] as! String != ""){
164
- // _lblTitle.textColor = UIColor(hexString: accuraErrorCode["CameraScreen_Text_Color"] as! String)
165
- // lblOCRMsg.textColor = UIColor(hexString: accuraErrorCode["CameraScreen_Text_Color"] as! String)
166
167
  // }
167
168
 
168
- if(accuraErrorCode["CameraScreen_Text_Color"] as! String != ""){
169
+ if(accuraErrorCode["CameraScreen_Heading_Text_Color"] as! String != ""){
169
170
  _lblTitle.attributedText = NSAttributedString(string: " ", attributes: strokeTextAttributes)
170
- lblOCRMsg.attributedText = NSAttributedString(string: " ", attributes: strokeTextAttributes)
171
+ // lblOCRMsg.attributedText = NSAttributedString(string: " ", attributes: strokeTextAttributes)
172
+ }
173
+
174
+ let strokeTextAttributesE: [NSAttributedString.Key : Any] = [
175
+ .strokeColor : accuraErrorCode["CameraScreen_Error_Text_Border_Color"] as! String != "" ? UIColor(hexString: accuraErrorCode["CameraScreen_Error_Text_Border_Color"] as! String): UIColor.clear,
176
+ .foregroundColor : UIColor(hexString: accuraErrorCode["CameraScreen_Error_Text_Color"] as! String),
177
+ .strokeWidth : -3.0,
178
+ ]
179
+
180
+ // }
181
+
182
+ if(accuraErrorCode["CameraScreen_Error_Text_Color"] as! String != ""){
183
+ // _lblTitle.attributedText = NSAttributedString(string: " ", attributes: strokeTextAttributesE)
184
+ lblOCRMsg.attributedText = NSAttributedString(string: " ", attributes: strokeTextAttributesE)
171
185
  }
172
186
  // font size
173
- if let lblTextSize = accuraErrorCode["CameraScreen_Label_Text_Size"] as? Int {
174
- _lblTitle.font = UIFont.systemFont(ofSize: CGFloat(lblTextSize))
175
- lblOCRMsg.font = UIFont.systemFont(ofSize: CGFloat(lblTextSize))
187
+ if let lblTextSize = accuraErrorCode["CameraScreen_Heading_Text_Size"] as? Int {
188
+ if let fontPath = accuraErrorCode["fontStyle"] {
189
+ // loadFont(from: fontPath as? String ?? "")
190
+ loadCustomFont(from: fontPath as? String ?? "")
191
+ }
192
+
193
+ // Use the custom font in a UILabel
194
+ if accuraErrorCode["fontName"] as! String == "" {
195
+ _lblTitle.font = UIFont.systemFont(ofSize: CGFloat(lblTextSize))
196
+ }else{
197
+ _lblTitle.font = UIFont(name: accuraErrorCode["fontName"] as! String, size: CGFloat(lblTextSize))
198
+ }
176
199
  }else{
177
200
  _lblTitle.font = UIFont.systemFont(ofSize: CGFloat(16.0))
201
+ }
202
+
203
+ if let lblTextSize = accuraErrorCode["CameraScreen_Error_Text_Size"] as? Int {
204
+ if let fontPath = accuraErrorCode["fontStyle"] {
205
+ // loadFont(from: fontPath as? String ?? "")
206
+ loadCustomFont(from: fontPath as? String ?? "")
207
+ }
208
+
209
+ // Use the custom font in a UILabel
210
+ // lblOCRMsg.font = UIFont(name: accuraErrorCode["fontName"] as! String, size: CGFloat(lblTextSize))
211
+ if accuraErrorCode["fontName"] as! String == "" {
212
+ lblOCRMsg.font = UIFont.systemFont(ofSize: CGFloat(lblTextSize))
213
+ }else{
214
+ lblOCRMsg.font = UIFont(name: accuraErrorCode["fontName"] as! String, size: CGFloat(lblTextSize))
215
+ }
216
+ }else{
178
217
  lblOCRMsg.font = UIFont.systemFont(ofSize: CGFloat(16.0))
179
218
  }
180
219
 
@@ -319,6 +358,10 @@ class ViewController: UIViewController {
319
358
  }
320
359
  }
321
360
 
361
+ DispatchQueue.main.async {
362
+ self.flipImageWidth.constant = self.accuraErrorCode["CameraScreen_Flip_Image_Width"] as? CGFloat ?? 80.0
363
+ self.flipImageHeight.constant = self.accuraErrorCode["CameraScreen_Flip_Image_Height"] as? CGFloat ?? 80.0
364
+ }
322
365
  }
323
366
 
324
367
  override func viewWillLayoutSubviews() {
@@ -507,6 +550,53 @@ class ViewController: UIViewController {
507
550
  }
508
551
 
509
552
  }
553
+
554
+ func loadFont(from path: String) {
555
+ guard let fontData = NSData(contentsOfFile: path) else {
556
+ print("Failed to load font data from path: \(path)")
557
+ return
558
+ }
559
+ guard let provider = CGDataProvider(data: fontData) else {
560
+ print("Failed to create CGDataProvider from font data")
561
+ return
562
+ }
563
+ guard let font = CGFont(provider) else {
564
+ print("Failed to create CGFont from provider")
565
+ return
566
+ }
567
+ var error: Unmanaged<CFError>?
568
+ CTFontManagerRegisterGraphicsFont(font, &error)
569
+ if let error = error {
570
+ print("Error registering font: \(error.takeUnretainedValue())")
571
+ }
572
+ }
573
+
574
+ func loadCustomFont(from path: String) {
575
+ guard let fontURL = URL(string: path) else {
576
+ print("Failed to find the font file.")
577
+ return
578
+ }
579
+
580
+ guard let fontDataProvider = CGDataProvider(url: fontURL as CFURL) else {
581
+ print("Failed to create the font data provider.")
582
+ return
583
+ }
584
+
585
+ guard let newFont = CGFont(fontDataProvider) else {
586
+ print("Failed to create the CGFont object.")
587
+ return
588
+ }
589
+
590
+ var error: Unmanaged<CFError>?
591
+ if !CTFontManagerRegisterGraphicsFont(newFont, &error) {
592
+ if let error = error?.takeUnretainedValue() {
593
+ print("Error registering font: \(error.localizedDescription)")
594
+ }
595
+ } else {
596
+ print("Font registered successfully!")
597
+ }
598
+ }
599
+
510
600
  var mutableArray: NSMutableArray = []
511
601
  var keyArr: NSMutableArray = []
512
602
  var valueArr: NSMutableArray = []
@@ -1854,19 +1944,6 @@ extension ViewController: VideoCameraWrapperDelegate {
1854
1944
  }
1855
1945
  }
1856
1946
 
1857
- var code = "KWT"
1858
-
1859
- if countryid == 9 {
1860
- code = "KWT"
1861
- }
1862
- if countryid == 26 {
1863
- code = "BHR"
1864
- }
1865
- let parameters: [String: Any] = [
1866
- "country_code": code
1867
- ]
1868
-
1869
-
1870
1947
  var results:[String: Any] = [:]
1871
1948
  var frontData:[String: Any] = [:]
1872
1949
  var backData:[String: Any] = [:]
@@ -8,6 +8,5 @@ var _reactNative = require("react-native");
8
8
  const {
9
9
  AccurascanKyc
10
10
  } = _reactNative.NativeModules;
11
- var _default = AccurascanKyc;
12
- exports.default = _default;
11
+ var _default = exports.default = AccurascanKyc;
13
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","AccurascanKyc","NativeModules","_default","exports","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAM;EAAEC;AAAc,CAAC,GAAGC,0BAAa;AAAC,IAAAC,QAAA,GAEzBF,aAAa;AAAAG,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_reactNative","require","AccurascanKyc","NativeModules","_default","exports","default"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAM;EAAEC;AAAc,CAAC,GAAGC,0BAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzBJ,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","AccurascanKyc"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,MAAM;EAAEC;AAAc,CAAC,GAAGD,aAAa;AAEvC,eAAeC,aAAa"}
1
+ {"version":3,"names":["NativeModules","AccurascanKyc"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,MAAM;EAAEC;AAAc,CAAC,GAAGD,aAAa;AAEvC,eAAeC,aAAa","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurascan_kyc",
3
- "version": "1.2.4-KYC",
3
+ "version": "1.2.5-Sim",
4
4
  "description": "Accura Scan",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",