accurascan_kyc 1.2.2 → 1.2.4-KYC

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.3"
25
+ s.dependency "AccuraKYC_Sim","4.0.4"
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"
@@ -102,9 +102,9 @@ dependencies {
102
102
  // For Accura OCR SDK
103
103
  implementation 'com.github.accurascan:AccuraOCR:5.5.0'
104
104
  // For Accura Face match
105
- implementation 'com.github.accurascan:AccuraFaceMatch:3.2.0'
105
+ implementation 'com.github.accurascan:AccuraFaceMatch:3.2.2'
106
106
  // for liveness
107
- implementation 'com.github.accurascan:Liveness-Android:3.3.0'
107
+ implementation 'com.github.accurascan:Liveness-Android:3.3.1'
108
108
  implementation 'com.squareup.picasso:picasso:2.71828'
109
109
  }
110
110
 
@@ -150,19 +150,23 @@ 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
- country.put("name", modelList.get(i).getCountry_name());
154
- country.put("id", modelList.get(i).getCountry_id());
155
- JSONArray cards = new JSONArray();
156
- List<ContryModel.CardModel> cardList = modelList.get(i).getCards();
157
- for (int j = 0; j < cardList.size(); j++) {
158
- JSONObject card = new JSONObject();
159
- card.put("name", cardList.get(j).getCard_name());
160
- card.put("id", cardList.get(j).getCard_id());
161
- card.put("type", cardList.get(j).getCard_type());
162
- cards.put(card);
153
+ if (Objects.equals(modelList.get(i).getCountry_name(), "Saint Kitts and Nevis")) {
154
+ results.put("isSchengen", true);
155
+ } else {
156
+ country.put("name", modelList.get(i).getCountry_name());
157
+ country.put("id", modelList.get(i).getCountry_id());
158
+ JSONArray cards = new JSONArray();
159
+ List<ContryModel.CardModel> cardList = modelList.get(i).getCards();
160
+ for (int j = 0; j < cardList.size(); j++) {
161
+ JSONObject card = new JSONObject();
162
+ card.put("name", cardList.get(j).getCard_name());
163
+ card.put("id", cardList.get(j).getCard_id());
164
+ card.put("type", cardList.get(j).getCard_type());
165
+ cards.put(card);
166
+ }
167
+ country.put("cards", cards);
168
+ countries.put(country);
163
169
  }
164
- country.put("cards", cards);
165
- countries.put(country);
166
170
  }
167
171
  results.put("countries", countries);
168
172
  }
@@ -216,7 +220,7 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
216
220
  actualAccuraErrorConfg.put("Disable_Card_Name",false);
217
221
  actualAccuraErrorConfg.put("flipImage","");
218
222
  actualAccuraErrorConfg.put("setCameraFacing",0);
219
- actualAccuraErrorConfg.put("enableLogs",1);
223
+ // actualAccuraErrorConfg.put("enableLogs",1);
220
224
  actualAccuraErrorConfg.put("isShowLogo",1);
221
225
  actualAccuraErrorConfg.put("isFlipImg",1);
222
226
  actualAccuraErrorConfg.put("CameraScreen_Frame_Color","#D5323F");
@@ -435,26 +439,49 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
435
439
  JSONArray args = ReactNativeJSON.convertArrayToJson(argsNew);
436
440
 
437
441
  String mrzType = args.getString(0);
438
- Intent intent = new Intent(getCurrentActivity(),OcrActivity.class);
439
- RecogType.MRZ.attachTo(intent);
440
- OcrActivity.recogType = RecogType.MRZ;
441
- if (mrzType.equals("passport_mrz")) {
442
- MRZDocumentType.PASSPORT_MRZ.attachTo(intent);
443
- }else if (mrzType.equals("id_mrz")){
444
- MRZDocumentType.ID_CARD_MRZ.attachTo(intent);
445
- }else if (mrzType.equals("visa_card")){
446
- MRZDocumentType.VISA_MRZ.attachTo(intent);
447
- }else{
448
- MRZDocumentType.NONE.attachTo(intent);
449
- }
450
- OcrActivity.accuraErrorConfg = accuraErrorConfg;
451
- OcrActivity.accuraTitleMsg = accuraTitleMsg;
452
- intent.putExtra("card_name",mrzType);
453
- intent.putExtra("app_orientation", Objects.requireNonNull(getCurrentActivity()).getRequestedOrientation());
454
- onResult = callbackContext;
455
442
 
456
- getCurrentActivity().startActivity(intent);
457
- return true;
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 {
465
+ Intent intent = new Intent(getCurrentActivity(),OcrActivity.class);
466
+ RecogType.MRZ.attachTo(intent);
467
+ OcrActivity.recogType = RecogType.MRZ;
468
+ if (mrzType.equals("passport_mrz")) {
469
+ MRZDocumentType.PASSPORT_MRZ.attachTo(intent);
470
+ }else if (mrzType.equals("id_mrz")){
471
+ MRZDocumentType.ID_CARD_MRZ.attachTo(intent);
472
+ }else if (mrzType.equals("visa_card")){
473
+ MRZDocumentType.VISA_MRZ.attachTo(intent);
474
+ }else{
475
+ MRZDocumentType.NONE.attachTo(intent);
476
+ }
477
+ OcrActivity.accuraErrorConfg = accuraErrorConfg;
478
+ OcrActivity.accuraTitleMsg = accuraTitleMsg;
479
+ intent.putExtra("card_name",mrzType);
480
+ intent.putExtra("app_orientation", Objects.requireNonNull(getCurrentActivity()).getRequestedOrientation());
481
+ onResult = callbackContext;
482
+ getCurrentActivity().startActivity(intent);
483
+ return true;
484
+ }
458
485
  }
459
486
 
460
487
  @ReactMethod
@@ -100,15 +100,12 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
100
100
  @Override
101
101
  public void handleMessage(Message msg) {
102
102
  OcrActivity activity = mActivity.get();
103
- try{
104
- if(accuraErrorConfg.getInt("enableLogs") == 1){
105
- AccuraLog.enableLogs(true); // make sure to disable logs in release mode
106
- AccuraLivenessLog.setDEBUG(true);
107
- AccuraLog.refreshLogfile(activity);
108
- }
109
- } catch (JSONException e) {
110
- e.printStackTrace();
111
- }
103
+
104
+ // if(accuraErrorConfg.getInt("enableLogs") == 1){
105
+ AccuraLog.enableLogs(false); // make sure to disable logs in release mode
106
+ AccuraLivenessLog.setDEBUG(false);
107
+ // AccuraLog.refreshLogfile(activity);
108
+ // }
112
109
 
113
110
 
114
111
  if (activity != null) {
@@ -429,7 +429,15 @@ public class OcrResultActivity extends Activity implements FaceCallback {
429
429
  } catch (JSONException e) {
430
430
  e.printStackTrace();
431
431
  }
432
- //livenessCustomization.logoIcon = R.drawable.accura_liveness_logo; // To set your custom logo
432
+
433
+ if (livenessConfig.has("setDefaultText")){
434
+ try {
435
+ livenessCustomization.feedBackTopMessage = livenessConfig.getString("setDefaultText");
436
+ } catch (JSONException e) {
437
+ e.printStackTrace();
438
+ }
439
+ }
440
+ //livenessCustomization.logoIcon = R.drawable.accura_liveness_logo; // To set your custom logo
433
441
  //livenessCustomization.facing = LivenessCustomization.CAMERA_FACING_FRONT;
434
442
 
435
443
 
@@ -123,10 +123,10 @@ class AccurascanKyc: NSObject {
123
123
  var results:[String: Any] = [:]
124
124
  results["isValid"] = false
125
125
  accuraCameraWrapper = AccuraCameraWrapper.init()
126
- // DispatchQueue.main.async {
127
- // self.accuraCameraWrapper?.setDefaultDialogs(true)
128
- // self.accuraCameraWrapper?.showLogFile(true) // Set true to print log from KYC SDK
129
- // }
126
+ // DispatchQueue.main.async {
127
+ // self.accuraCameraWrapper?.setDefaultDialogs(true)
128
+ // self.accuraCameraWrapper?.showLogFile(true) // Set true to print log from KYC SDK
129
+ // }
130
130
 
131
131
  // DispatchQueue.main.async {
132
132
  DispatchQueue.main.async {
@@ -143,24 +143,28 @@ class AccurascanKyc: NSObject {
143
143
  results["isBankCard"] = sdkModel!.isBankCardEnable
144
144
  results["isMRZ"] = sdkModel!.isMRZEnable
145
145
 
146
+
146
147
  let countryListStr = self.accuraCameraWrapper!.getOCRList();
147
148
  for item in countryListStr ?? [] {
148
149
  let cntry = item as! NSDictionary
149
150
  var country:[String: Any] = [:]
150
-
151
- country["name"] = cntry.value(forKey: "country_name")
152
- country["id"] = cntry.value(forKey: "country_id")
153
- var cards:[[String: Any]] = []
154
- for cd in cntry.value(forKey: "cards") as! NSArray {
155
- let cardF = cd as! NSDictionary
156
- var card:[String: Any] = [:]
157
- card["name"] = cardF.value(forKey:"card_name")
158
- card["id"] = cardF.value(forKey:"card_id")
159
- card["type"] = cardF.value(forKey:"card_type")
160
- cards.append(card)
151
+ if cntry.value(forKey: "country_name") as? String == "Saint Kitts and Nevis" {
152
+ results["isSchengen"] = true
153
+ }else{
154
+ country["name"] = cntry.value(forKey: "country_name")
155
+ country["id"] = cntry.value(forKey: "country_id")
156
+ var cards:[[String: Any]] = []
157
+ for cd in cntry.value(forKey: "cards") as! NSArray {
158
+ let cardF = cd as! NSDictionary
159
+ var card:[String: Any] = [:]
160
+ card["name"] = cardF.value(forKey:"card_name")
161
+ card["id"] = cardF.value(forKey:"card_id")
162
+ card["type"] = cardF.value(forKey:"card_type")
163
+ cards.append(card)
164
+ }
165
+ country["cards"] = cards
166
+ countries.append(country)
161
167
  }
162
- country["cards"] = cards
163
- countries.append(country)
164
168
  }
165
169
  results["countries"] = countries
166
170
  if sdkModel!.isBarcodeEnable {
@@ -273,15 +277,16 @@ class AccurascanKyc: NSObject {
273
277
  }else{
274
278
  self.accuraCameraWrapper?.setCameraFacing(.CAMERA_FACING_BACK)
275
279
  }
276
- if accuraconfigs["enableLogs"] != nil {
277
- if accuraconfigs["enableLogs"] as? Int == 1 {
278
- accuraCameraWrapper?.showLogFile(true)
279
- } else{
280
- accuraCameraWrapper?.showLogFile(false)
281
- }
282
- } else{
283
- accuraCameraWrapper?.showLogFile(false)
284
- }
280
+ // if accuraconfigs["enableLogs"] != nil {
281
+ // if accuraconfigs["enableLogs"] as? Int == 0 {
282
+ // accuraCameraWrapper?.showLogFile(true)
283
+ // accuraCameraWrapper?.setDefaultDialogs(true)
284
+ // } else{
285
+ // accuraCameraWrapper?.showLogFile(false)
286
+ // }
287
+ // } else{
288
+ // accuraCameraWrapper?.showLogFile(false)
289
+ // }
285
290
  // accuraCameraWrapper?.setCheckPhotoCopy(((configs!["isCheckPhotoCopy"] as? Bool)!))
286
291
  // self.accuraCameraWrapper?.setCheckPhotoCopy(false, stCheckPhotoMessage: "")
287
292
  // }
@@ -330,27 +335,47 @@ class AccurascanKyc: NSObject {
330
335
  lvfm.faceImage = nil
331
336
  self.goNativeCallBack = callback;
332
337
  self.goNativeArgs = argsNew;
333
- DispatchQueue.main.async {
334
- let viewController = UIStoryboard(name: "MainStoryboard_iPhone", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
335
- if self.goNativeArgs[0] as! String == "passport_mrz" {
336
- viewController.MRZDocType = 1
337
- }else if self.goNativeArgs[0] as! String == "visa_card" {
338
- viewController.MRZDocType = 3
339
- }else if self.goNativeArgs[0] as! String == "id_mrz" {
340
- viewController.MRZDocType = 2
341
- }else{
342
- viewController.MRZDocType = 0
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{
357
+ DispatchQueue.main.async {
358
+ let viewController = UIStoryboard(name: "MainStoryboard_iPhone", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
359
+ if self.goNativeArgs[0] as! String == "passport_mrz" {
360
+ viewController.MRZDocType = 1
361
+ }else if self.goNativeArgs[0] as! String == "visa_card" {
362
+ viewController.MRZDocType = 3
363
+ }else if self.goNativeArgs[0] as! String == "id_mrz" {
364
+ viewController.MRZDocType = 2
365
+ }else{
366
+ viewController.MRZDocType = 0
367
+ }
368
+ viewController.callBack = self.goNativeCallBack
369
+ viewController.isCheckScanOCR = false
370
+ viewController.reactViewController = self.viewController
371
+ viewController.accuraTitleMsg = self.accuraTitleMsg
372
+ viewController.accuraErrorCode = self.accuraconfigs
373
+ viewController.modalPresentationStyle = .fullScreen
374
+ viewController.modalTransitionStyle = .coverVertical
375
+ // DispatchQueue.main.async {
376
+ // viewController.modalPresentationStyle = .fullScreen
377
+ self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
343
378
  }
344
- viewController.callBack = self.goNativeCallBack
345
- viewController.isCheckScanOCR = false
346
- viewController.reactViewController = self.viewController
347
- viewController.accuraTitleMsg = self.accuraTitleMsg
348
- viewController.accuraErrorCode = self.accuraconfigs
349
- viewController.modalPresentationStyle = .fullScreen
350
- viewController.modalTransitionStyle = .coverVertical
351
- // DispatchQueue.main.async {
352
- // viewController.modalPresentationStyle = .fullScreen
353
- self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
354
379
  }
355
380
  }
356
381
 
@@ -137,6 +137,7 @@ class LVController: UIViewController,LivenessData,FacematchData
137
137
  liveness.setGlarePercentage(-1, -1) //set glaremin -1 to remove this filter
138
138
  }
139
139
 
140
+ liveness.setAlertText("Remove Cap/Glasses To Proceed For Liveness Check")
140
141
 
141
142
  liveness.setDefaultText("Keep Face In Frame\nFace Must Be Near To Camera")
142
143
  // 0 for clean face and 100 for Blurry face
@@ -1854,6 +1854,19 @@ extension ViewController: VideoCameraWrapperDelegate {
1854
1854
  }
1855
1855
  }
1856
1856
 
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
+
1857
1870
  var results:[String: Any] = [:]
1858
1871
  var frontData:[String: Any] = [:]
1859
1872
  var backData:[String: Any] = [:]
@@ -1962,7 +1975,6 @@ extension ViewController: VideoCameraWrapperDelegate {
1962
1975
  // mrzData["Document Type"] = shareScanningListing["passportType"]
1963
1976
  }
1964
1977
  }
1965
-
1966
1978
  results["front_data"] = frontData
1967
1979
  results["back_data"] = backData
1968
1980
  results["mrz_data"] = mrzData
@@ -2783,3 +2795,10 @@ extension UIView {
2783
2795
 
2784
2796
  }
2785
2797
 
2798
+ extension Data {
2799
+ mutating func append(_ string: String) {
2800
+ if let data = string.data(using: .utf8) {
2801
+ append(data)
2802
+ }
2803
+ }
2804
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accurascan_kyc",
3
- "version": "1.2.2",
3
+ "version": "1.2.4-KYC",
4
4
  "description": "Accura Scan",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",