accurascan_kyc 1.2.7 → 1.2.8
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/android/build.gradle +6 -6
- package/android/src/main/java/com/accurascankyc/AccurascanKycModule.java +1 -91
- package/android/src/main/java/com/accurascankyc/ActivityFaceMatch.java +2 -11
- package/android/src/main/java/com/accurascankyc/OcrActivity.java +1 -1
- package/android/src/main/java/com/accurascankyc/OcrResultActivity.java +1 -11
- package/android/src/main/res/layout/custom_frame_layout.xml +1 -1
- package/android/src/main/res/layout-land/custom_frame_layout.xml +1 -1
- package/ios/AccurascanKyc.m +0 -2
- package/ios/AccurascanKyc.swift +34 -143
- package/package.json +1 -2
package/android/build.gradle
CHANGED
|
@@ -99,12 +99,12 @@ dependencies {
|
|
|
99
99
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
100
100
|
implementation 'androidx.appcompat:appcompat:1.6.0'
|
|
101
101
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
// Update OCR
|
|
103
|
+
implementation 'com.github.accurascan:AccuraOCR:5.5.0.0'
|
|
104
|
+
// FaceMatch has no issue
|
|
105
|
+
implementation 'com.github.accurascan:AccuraFaceMatch:3.2.2'
|
|
106
|
+
// Update Liveness
|
|
107
|
+
implementation 'com.github.accurascan:Liveness-Android:3.3.1.1'
|
|
108
108
|
implementation 'com.squareup.picasso:picasso:2.71828'
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -64,9 +64,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
64
64
|
public static JSONObject actualAccuraErrorConfg = new JSONObject();
|
|
65
65
|
|
|
66
66
|
private String bType;
|
|
67
|
-
public static Boolean isDynamic = false;
|
|
68
|
-
public static String LicenseAbsolutePath = "";
|
|
69
|
-
public static String FaceLicenseAbsolutePath = "";
|
|
70
67
|
|
|
71
68
|
public AccurascanKycModule(ReactApplicationContext reactContext) {
|
|
72
69
|
super(reactContext);
|
|
@@ -130,7 +127,7 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
130
127
|
|
|
131
128
|
@ReactMethod
|
|
132
129
|
public boolean getMetaData( Callback callbackContext ) throws JSONException {
|
|
133
|
-
|
|
130
|
+
|
|
134
131
|
onResult = callbackContext;
|
|
135
132
|
RecogEngine recogEngine = new RecogEngine();
|
|
136
133
|
AccuraLog.enableLogs(false);
|
|
@@ -196,83 +193,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
196
193
|
return true;
|
|
197
194
|
}
|
|
198
195
|
|
|
199
|
-
@ReactMethod
|
|
200
|
-
public boolean getDynamicMetaData(ReadableArray argsNew, Callback callbackContext ) throws JSONException {
|
|
201
|
-
|
|
202
|
-
onResult = callbackContext;
|
|
203
|
-
RecogEngine recogEngine = new RecogEngine();
|
|
204
|
-
AccuraLog.enableLogs(false);
|
|
205
|
-
recogEngine.setDialog(false);
|
|
206
|
-
JSONObject results = new JSONObject();
|
|
207
|
-
|
|
208
|
-
JSONArray args = ReactNativeJSON.convertArrayToJson(argsNew);
|
|
209
|
-
JSONObject accuraConf = args.getJSONObject(0);
|
|
210
|
-
|
|
211
|
-
LicenseAbsolutePath = accuraConf.getString("licensePath");
|
|
212
|
-
FaceLicenseAbsolutePath = accuraConf.getString("faceLicensePath");
|
|
213
|
-
isDynamic = true;
|
|
214
|
-
|
|
215
|
-
RecogEngine.SDKModel sdkModel = recogEngine.initEngine(getReactApplicationContext(), LicenseAbsolutePath);
|
|
216
|
-
|
|
217
|
-
if (sdkModel.i >= 0) {
|
|
218
|
-
// AndroidNetworking.initialize(getReactApplicationContext(), UnsafeOkHttpClient.getUnsafeOkHttpClient());
|
|
219
|
-
results.put("sdk_version", recogEngine.getVersion());
|
|
220
|
-
|
|
221
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !isPermissionsGranted(getCurrentActivity())) {
|
|
222
|
-
requestCameraPermission();
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
results.put("isValid", true);
|
|
226
|
-
// if OCR enable then get card list
|
|
227
|
-
if (sdkModel.isOCREnable) {
|
|
228
|
-
results.put("isOCR", true);
|
|
229
|
-
List<ContryModel> modelList = recogEngine.getCardList(getCurrentActivity());
|
|
230
|
-
JSONArray countries = new JSONArray();
|
|
231
|
-
for (int i = 0; i < modelList.size(); i++) {
|
|
232
|
-
JSONObject country = new JSONObject();
|
|
233
|
-
// if (Objects.equals(modelList.get(i).getCountry_name(), "Saint Kitts and Nevis")) {
|
|
234
|
-
// results.put("isSchengen", true);
|
|
235
|
-
// } else {
|
|
236
|
-
country.put("name", modelList.get(i).getCountry_name());
|
|
237
|
-
country.put("id", modelList.get(i).getCountry_id());
|
|
238
|
-
JSONArray cards = new JSONArray();
|
|
239
|
-
List<ContryModel.CardModel> cardList = modelList.get(i).getCards();
|
|
240
|
-
for (int j = 0; j < cardList.size(); j++) {
|
|
241
|
-
JSONObject card = new JSONObject();
|
|
242
|
-
card.put("name", cardList.get(j).getCard_name());
|
|
243
|
-
card.put("id", cardList.get(j).getCard_id());
|
|
244
|
-
card.put("type", cardList.get(j).getCard_type());
|
|
245
|
-
cards.put(card);
|
|
246
|
-
}
|
|
247
|
-
country.put("cards", cards);
|
|
248
|
-
countries.put(country);
|
|
249
|
-
// }
|
|
250
|
-
}
|
|
251
|
-
results.put("countries", countries);
|
|
252
|
-
}
|
|
253
|
-
results.put("isOCREnable", sdkModel.isOCREnable);
|
|
254
|
-
results.put("isBarcode", sdkModel.isAllBarcodeEnable);
|
|
255
|
-
if (sdkModel.isAllBarcodeEnable) {
|
|
256
|
-
List<BarcodeFormat> CODE_NAMES = BarcodeFormat.getList();
|
|
257
|
-
JSONArray barcodes = new JSONArray();
|
|
258
|
-
for (int i = 0; i < CODE_NAMES.size(); i++) {
|
|
259
|
-
JSONObject barcode = new JSONObject();
|
|
260
|
-
barcode.put("name", CODE_NAMES.get(i).barcodeTitle);
|
|
261
|
-
barcode.put("type", CODE_NAMES.get(i).formatsType);
|
|
262
|
-
barcodes.put(barcode);
|
|
263
|
-
}
|
|
264
|
-
results.put("barcodes", barcodes);
|
|
265
|
-
}
|
|
266
|
-
results.put("isBankCard", sdkModel.isBankCardEnable);
|
|
267
|
-
results.put("isMRZ", sdkModel.isMRZEnable);
|
|
268
|
-
|
|
269
|
-
} else {
|
|
270
|
-
results.put("isValid", false);
|
|
271
|
-
}
|
|
272
|
-
callbackContext.invoke(null, results.toString());
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
196
|
@ReactMethod
|
|
277
197
|
public boolean setupAccuraConfig(ReadableArray argsNew, Callback result) throws JSONException {
|
|
278
198
|
|
|
@@ -433,8 +353,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
433
353
|
ActivityFaceMatch.faceMatchConfig = args.getJSONObject(1);
|
|
434
354
|
ActivityFaceMatch.sface = accuraConf.getString("face1");
|
|
435
355
|
ActivityFaceMatch.mface = accuraConf.getString("face2");
|
|
436
|
-
ActivityFaceMatch.faceLicensePath = FaceLicenseAbsolutePath;
|
|
437
|
-
ActivityFaceMatch.isDynamic = isDynamic;
|
|
438
356
|
Intent intent = new Intent(getCurrentActivity(), ActivityFaceMatch.class);
|
|
439
357
|
getCurrentActivity().startActivity(intent);
|
|
440
358
|
return true;
|
|
@@ -450,8 +368,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
450
368
|
JSONObject accuraConf = args.getJSONObject(0);
|
|
451
369
|
ActivityFaceMatch.sface = accuraConf.getString("face1");
|
|
452
370
|
ActivityFaceMatch.mface = accuraConf.getString("face2");
|
|
453
|
-
ActivityFaceMatch.faceLicensePath = FaceLicenseAbsolutePath;
|
|
454
|
-
ActivityFaceMatch.isDynamic = isDynamic;
|
|
455
371
|
// JSONObject config = args.getJSONObject(1);
|
|
456
372
|
Intent intent = new Intent(getCurrentActivity(), ActivityFaceMatch.class);
|
|
457
373
|
// intent = addDefaultConfigs(intent, accuraConf);
|
|
@@ -469,8 +385,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
469
385
|
JSONObject accuraConf = args.getJSONObject(0);
|
|
470
386
|
ActivityFaceMatch.sface = accuraConf.getString("face1");
|
|
471
387
|
ActivityFaceMatch.mface = accuraConf.getString("face2");
|
|
472
|
-
ActivityFaceMatch.faceLicensePath = FaceLicenseAbsolutePath;
|
|
473
|
-
ActivityFaceMatch.isDynamic = isDynamic;
|
|
474
388
|
// JSONObject config = args.getJSONObject(1);
|
|
475
389
|
Intent intent = new Intent(getCurrentActivity(), ActivityFaceMatch.class);
|
|
476
390
|
// intent = ActivityFaceMatch(intent, accuraConf);
|
|
@@ -491,8 +405,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
491
405
|
ActivityFaceMatch.faceMatchConfig = args.getJSONObject(1);
|
|
492
406
|
ActivityFaceMatch.sface = accuraConf.getString("face1");
|
|
493
407
|
ActivityFaceMatch.mface = accuraConf.getString("face2");
|
|
494
|
-
ActivityFaceMatch.faceLicensePath = FaceLicenseAbsolutePath;
|
|
495
|
-
ActivityFaceMatch.isDynamic = isDynamic;
|
|
496
408
|
// JSONObject config = args.getJSONObject(1);
|
|
497
409
|
Intent intent = new Intent(getCurrentActivity(), ActivityFaceMatch.class);
|
|
498
410
|
// intent = addDefaultConfigs(intent, accuraConf);
|
|
@@ -615,8 +527,6 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
615
527
|
OcrResultActivity.face1 = BitmapFactory.decodeFile(uri.replace("file://",""));
|
|
616
528
|
OcrResultActivity.which = 0;
|
|
617
529
|
OcrResultActivity.faceConfig = arg.getJSONObject(1);
|
|
618
|
-
OcrResultActivity.faceLicensePath = FaceLicenseAbsolutePath;
|
|
619
|
-
OcrResultActivity.isDynamic = isDynamic;
|
|
620
530
|
Intent intent = new Intent(getCurrentActivity(),OcrResultActivity.class);
|
|
621
531
|
Objects.requireNonNull(getCurrentActivity()).startActivity(intent);
|
|
622
532
|
|
|
@@ -44,8 +44,7 @@ public class ActivityFaceMatch extends Activity implements FaceCallback {
|
|
|
44
44
|
public static int which;
|
|
45
45
|
public static int No;
|
|
46
46
|
public static JSONObject faceMatchConfig;
|
|
47
|
-
|
|
48
|
-
public static Boolean isDynamic;
|
|
47
|
+
|
|
49
48
|
|
|
50
49
|
@Override
|
|
51
50
|
protected void onCreate(Bundle savedInstanceState) {
|
|
@@ -54,15 +53,7 @@ public class ActivityFaceMatch extends Activity implements FaceCallback {
|
|
|
54
53
|
|
|
55
54
|
helper = new FaceHelper(this);
|
|
56
55
|
helper.setFaceMatchCallBack(this);
|
|
57
|
-
|
|
58
|
-
if(isDynamic){
|
|
59
|
-
// System.out.println("FaceMatch activity isDynamic true");
|
|
60
|
-
helper.initEngine(faceLicensePath);
|
|
61
|
-
}else{
|
|
62
|
-
// System.out.println("FaceMatch activity isDynamic false");
|
|
63
|
-
helper.initEngine();
|
|
64
|
-
}
|
|
65
|
-
|
|
56
|
+
helper.initEngine();
|
|
66
57
|
image1 = new FaceImageview(this); //initialize the view of front image
|
|
67
58
|
image2 = new FaceImageview(this);
|
|
68
59
|
bundle = getIntent().getExtras();
|
|
@@ -31,7 +31,7 @@ import androidx.annotation.Nullable;
|
|
|
31
31
|
|
|
32
32
|
import com.accurascan.facedetection.utils.AccuraLivenessLog;
|
|
33
33
|
import com.accurascan.ocr.mrz.CameraView;
|
|
34
|
-
|
|
34
|
+
import com.accurascan.ocr.mrz.customview.CustomTextView;
|
|
35
35
|
import com.accurascan.ocr.mrz.interfaces.OcrCallback;
|
|
36
36
|
import com.accurascan.ocr.mrz.model.BarcodeFormat;
|
|
37
37
|
import com.accurascan.ocr.mrz.model.CardDetails;
|
|
@@ -47,9 +47,6 @@ public class OcrResultActivity extends Activity implements FaceCallback {
|
|
|
47
47
|
|
|
48
48
|
public static JSONObject faceConfig;
|
|
49
49
|
public static JSONObject livenessConfig;
|
|
50
|
-
public static String faceLicensePath;
|
|
51
|
-
public static Boolean isDynamic;
|
|
52
|
-
|
|
53
50
|
ImageView ivUserProfile2;
|
|
54
51
|
View loutImg2;
|
|
55
52
|
public static int which;
|
|
@@ -65,14 +62,7 @@ public class OcrResultActivity extends Activity implements FaceCallback {
|
|
|
65
62
|
|
|
66
63
|
faceHelper = new FaceHelper(this);
|
|
67
64
|
faceHelper.setFaceMatchCallBack(this);
|
|
68
|
-
|
|
69
|
-
if(isDynamic){
|
|
70
|
-
// System.out.println("FaceMatch activity isDynamic true");
|
|
71
|
-
faceHelper.initEngine(faceLicensePath);
|
|
72
|
-
}else{
|
|
73
|
-
// System.out.println("FaceMatch activity isDynamic false");
|
|
74
|
-
faceHelper.initEngine();
|
|
75
|
-
}
|
|
65
|
+
faceHelper.initEngine();
|
|
76
66
|
if (getIntent().getIntExtra("app_orientation", 1) != 0) {
|
|
77
67
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
78
68
|
} else {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
android:layout_alignParentEnd="true"
|
|
119
119
|
android:layout_alignParentBottom="true">
|
|
120
120
|
|
|
121
|
-
<
|
|
121
|
+
<com.accurascan.ocr.mrz.customview.CustomTextView
|
|
122
122
|
android:layout_width="wrap_content"
|
|
123
123
|
android:layout_height="wrap_content"
|
|
124
124
|
android:text=""
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
android:layout_alignParentEnd="true"
|
|
119
119
|
android:layout_alignParentBottom="true">
|
|
120
120
|
|
|
121
|
-
<
|
|
121
|
+
<com.accurascan.ocr.mrz.customview.CustomTextView
|
|
122
122
|
android:layout_width="wrap_content"
|
|
123
123
|
android:layout_height="wrap_content"
|
|
124
124
|
android:text=""
|
package/ios/AccurascanKyc.m
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
RCT_EXTERN_METHOD(getMetaData:(RCTResponseSenderBlock)callback)
|
|
6
6
|
|
|
7
|
-
RCT_EXTERN_METHOD(getDynamicMetaData:(NSArray *)argsNew callback:(RCTResponseSenderBlock)callback)
|
|
8
|
-
|
|
9
7
|
RCT_EXTERN_METHOD(setupAccuraConfig:(NSArray *)argsNew callback:(RCTResponseSenderBlock)callback)
|
|
10
8
|
|
|
11
9
|
RCT_EXTERN_METHOD(startMRZ:(NSArray *)argsNew callback:(RCTResponseSenderBlock)callback)
|
package/ios/AccurascanKyc.swift
CHANGED
|
@@ -21,9 +21,6 @@ class AccurascanKyc: NSObject {
|
|
|
21
21
|
var accuraTitleMsg:NSDictionary = [:]
|
|
22
22
|
var viewController: UIViewController? = nil;
|
|
23
23
|
var viewControllerWindow: UIWindow? = nil;
|
|
24
|
-
var LicenseAbsoultPath:String = "";
|
|
25
|
-
var FaceLicenseAbsoultPath:String = "";
|
|
26
|
-
var isDynamic:Bool = false;
|
|
27
24
|
|
|
28
25
|
var actualConfig:NSDictionary = [
|
|
29
26
|
"setFaceBlurPercentage": 80,
|
|
@@ -129,19 +126,6 @@ class AccurascanKyc: NSObject {
|
|
|
129
126
|
return nil
|
|
130
127
|
}
|
|
131
128
|
|
|
132
|
-
func faceLicenseInit() {
|
|
133
|
-
EngineWrapper.faceEngineClose()
|
|
134
|
-
let fmInit = EngineWrapper.isEngineInit()
|
|
135
|
-
if !fmInit{
|
|
136
|
-
if (isDynamic){
|
|
137
|
-
EngineWrapper.faceEngineInit(FaceLicenseAbsoultPath)
|
|
138
|
-
}else{
|
|
139
|
-
EngineWrapper.faceEngineInit()
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
129
|
|
|
146
130
|
@objc(getMetaData:)
|
|
147
131
|
func getMetaData(_ callback: @escaping RCTResponseSenderBlock) {
|
|
@@ -216,93 +200,6 @@ class AccurascanKyc: NSObject {
|
|
|
216
200
|
}
|
|
217
201
|
}
|
|
218
202
|
|
|
219
|
-
@objc(getDynamicMetaData:callback:)
|
|
220
|
-
func getDynamicMetaData(_ argsNew: NSArray, _ callback: @escaping RCTResponseSenderBlock) {
|
|
221
|
-
goNativeArgs = argsNew
|
|
222
|
-
goNativeCallBack = callback
|
|
223
|
-
isDynamic = true
|
|
224
|
-
var results:[String: Any] = [:]
|
|
225
|
-
results["isValid"] = false
|
|
226
|
-
|
|
227
|
-
guard let configs = goNativeArgs[0] as? [String: Any] else {
|
|
228
|
-
// print("Invalid argument format")
|
|
229
|
-
results["status"] = "Invalid argument format"
|
|
230
|
-
self.goNativeCallBack?([ AccurascanKyc.convertJSONString(results: results),NSNull()])
|
|
231
|
-
return
|
|
232
|
-
}
|
|
233
|
-
LicenseAbsoultPath = configs["licensePath"] as! String
|
|
234
|
-
FaceLicenseAbsoultPath = configs["faceLicensePath"] as! String
|
|
235
|
-
|
|
236
|
-
accuraCameraWrapper = AccuraCameraWrapper.init()
|
|
237
|
-
// DispatchQueue.main.async {
|
|
238
|
-
// self.accuraCameraWrapper?.setDefaultDialogs(true)
|
|
239
|
-
// self.accuraCameraWrapper?.showLogFile(true) // Set true to print log from KYC SDK
|
|
240
|
-
// }
|
|
241
|
-
|
|
242
|
-
DispatchQueue.main.async {
|
|
243
|
-
self.viewController = RCTPresentedViewController()!
|
|
244
|
-
self.viewControllerWindow = RCTKeyWindow()!
|
|
245
|
-
let sdkModel = self.accuraCameraWrapper!.loadEngine(self.LicenseAbsoultPath, documentDirectory: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String)
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if sdkModel!.i > 0 {
|
|
250
|
-
var countries:[Any] = []
|
|
251
|
-
results["sdk_version"] = ""
|
|
252
|
-
results["isValid"] = true
|
|
253
|
-
results["isOCR"] = sdkModel!.isOCREnable
|
|
254
|
-
results["isOCREnable"] = sdkModel!.isOCREnable
|
|
255
|
-
results["isBarcode"] = sdkModel!.isBarcodeEnable
|
|
256
|
-
results["isBankCard"] = sdkModel!.isBankCardEnable
|
|
257
|
-
results["isMRZ"] = sdkModel!.isMRZEnable
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
let countryListStr = self.accuraCameraWrapper!.getOCRList();
|
|
261
|
-
for item in countryListStr ?? [] {
|
|
262
|
-
let cntry = item as! NSDictionary
|
|
263
|
-
var country:[String: Any] = [:]
|
|
264
|
-
// if cntry.value(forKey: "country_name") as? String == "Saint Kitts and Nevis" {
|
|
265
|
-
// results["isSchengen"] = true
|
|
266
|
-
// }else{
|
|
267
|
-
country["name"] = cntry.value(forKey: "country_name")
|
|
268
|
-
country["id"] = cntry.value(forKey: "country_id")
|
|
269
|
-
var cards:[[String: Any]] = []
|
|
270
|
-
for cd in cntry.value(forKey: "cards") as! NSArray {
|
|
271
|
-
let cardF = cd as! NSDictionary
|
|
272
|
-
var card:[String: Any] = [:]
|
|
273
|
-
card["name"] = cardF.value(forKey:"card_name")
|
|
274
|
-
card["id"] = cardF.value(forKey:"card_id")
|
|
275
|
-
card["type"] = cardF.value(forKey:"card_type")
|
|
276
|
-
cards.append(card)
|
|
277
|
-
}
|
|
278
|
-
country["cards"] = cards
|
|
279
|
-
countries.append(country)
|
|
280
|
-
// }
|
|
281
|
-
}
|
|
282
|
-
results["countries"] = countries
|
|
283
|
-
if sdkModel!.isBarcodeEnable {
|
|
284
|
-
var barcodes:[[String: String]] = []
|
|
285
|
-
barcodes.append(["name": "ALL FORMATS","type": "ALL FORMATS"])
|
|
286
|
-
barcodes.append(["name": "EAN-8", "type": "EAN-8"])
|
|
287
|
-
barcodes.append(["name": "EAN-13", "type": "EAN-13"])
|
|
288
|
-
barcodes.append(["name": "PDF417", "type": "PDF417"])
|
|
289
|
-
barcodes.append(["name": "AZTEC", "type": "AZTEC"])
|
|
290
|
-
barcodes.append(["name": "CODE 128", "type": "CODE 128"])
|
|
291
|
-
barcodes.append(["name": "CODE 39", "type": "CODE 39"])
|
|
292
|
-
barcodes.append(["name": "CODE 93", "type": "CODE 93"])
|
|
293
|
-
barcodes.append(["name": "DATA MATRIX", "type": "DATA MATRIX"])
|
|
294
|
-
barcodes.append(["name": "QR CODE", "type": "QR CODE"])
|
|
295
|
-
barcodes.append(["name": "UPC-E", "type": "UPC-E"])
|
|
296
|
-
barcodes.append(["name": "UPC-A", "type": "UPC-A"])
|
|
297
|
-
barcodes.append(["name": "CODABAR", "type": "CODABAR"])
|
|
298
|
-
results["barcodes"] = barcodes
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
self.goNativeCallBack!([NSNull(), AccurascanKyc.convertJSONString(results: results)])
|
|
302
|
-
// }
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
203
|
@objc(startOcrWithCard:callback:)
|
|
307
204
|
func startOcrWithCard(_ argsNew: NSArray, callback: @escaping RCTResponseSenderBlock){
|
|
308
205
|
lvfm.faceImage = nil
|
|
@@ -498,14 +395,13 @@ class AccurascanKyc: NSObject {
|
|
|
498
395
|
self.goNativeArgs = argsNew;
|
|
499
396
|
let face:NSDictionary
|
|
500
397
|
face = goNativeArgs[0] as! NSDictionary
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
// }
|
|
398
|
+
EngineWrapper.faceEngineClose()
|
|
399
|
+
let fmInit = EngineWrapper.isEngineInit()
|
|
400
|
+
if !fmInit{
|
|
401
|
+
DispatchQueue.main.async {
|
|
402
|
+
EngineWrapper.faceEngineInit()
|
|
403
|
+
}
|
|
404
|
+
}
|
|
509
405
|
let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
|
|
510
406
|
if fmValue == -20{
|
|
511
407
|
self.goNativeCallBack!(["key not found", NSNull()])
|
|
@@ -537,12 +433,11 @@ class AccurascanKyc: NSObject {
|
|
|
537
433
|
self.goNativeArgs = argsNew;
|
|
538
434
|
let face:NSDictionary
|
|
539
435
|
face = self.goNativeArgs[0] as! NSDictionary
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
// }
|
|
436
|
+
EngineWrapper.faceEngineClose()
|
|
437
|
+
let fmInit = EngineWrapper.isEngineInit()
|
|
438
|
+
if !fmInit{
|
|
439
|
+
EngineWrapper.faceEngineInit()
|
|
440
|
+
}
|
|
546
441
|
let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
|
|
547
442
|
if fmValue == -20{
|
|
548
443
|
self.goNativeCallBack!(["key not found", NSNull()])
|
|
@@ -572,12 +467,11 @@ class AccurascanKyc: NSObject {
|
|
|
572
467
|
DispatchQueue.main.async {
|
|
573
468
|
self.goNativeCallBack = callback;
|
|
574
469
|
self.goNativeArgs = argsNew;
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
// }
|
|
470
|
+
EngineWrapper.faceEngineClose()
|
|
471
|
+
let fmInit = EngineWrapper.isEngineInit()
|
|
472
|
+
if !fmInit{
|
|
473
|
+
EngineWrapper.faceEngineInit()
|
|
474
|
+
}
|
|
581
475
|
let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
|
|
582
476
|
if fmValue == -20{
|
|
583
477
|
self.sendError(msg: "Key not found")
|
|
@@ -620,12 +514,11 @@ class AccurascanKyc: NSObject {
|
|
|
620
514
|
DispatchQueue.main.async {
|
|
621
515
|
self.goNativeCallBack = callback;
|
|
622
516
|
self.goNativeArgs = argsNew;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
// }
|
|
517
|
+
EngineWrapper.faceEngineClose()
|
|
518
|
+
let fmInit = EngineWrapper.isEngineInit()
|
|
519
|
+
if !fmInit{
|
|
520
|
+
EngineWrapper.faceEngineInit()
|
|
521
|
+
}
|
|
629
522
|
let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
|
|
630
523
|
if fmValue == -20{
|
|
631
524
|
self.sendError(msg: "Key not found")
|
|
@@ -664,14 +557,13 @@ class AccurascanKyc: NSObject {
|
|
|
664
557
|
DispatchQueue.main.async {
|
|
665
558
|
self.goNativeCallBack = callback;
|
|
666
559
|
self.goNativeArgs = argsNew;
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
// }
|
|
560
|
+
EngineWrapper.faceEngineClose()
|
|
561
|
+
let fmInit = EngineWrapper.isEngineInit()
|
|
562
|
+
if !fmInit{
|
|
563
|
+
DispatchQueue.main.async {
|
|
564
|
+
EngineWrapper.faceEngineInit()
|
|
565
|
+
}
|
|
566
|
+
}
|
|
675
567
|
let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
|
|
676
568
|
if fmValue == -20{
|
|
677
569
|
// goNativeCallBack!(FlutterError.init(code: "101", message: "Key not found", details: nil))
|
|
@@ -711,12 +603,11 @@ class AccurascanKyc: NSObject {
|
|
|
711
603
|
DispatchQueue.main.async {
|
|
712
604
|
self.goNativeCallBack = callback;
|
|
713
605
|
self.goNativeArgs = argsNew;
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
// }
|
|
606
|
+
EngineWrapper.faceEngineClose()
|
|
607
|
+
let fmInit = EngineWrapper.isEngineInit()
|
|
608
|
+
if !fmInit{
|
|
609
|
+
EngineWrapper.faceEngineInit()
|
|
610
|
+
}
|
|
720
611
|
let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
|
|
721
612
|
if fmValue == -20{
|
|
722
613
|
self.sendError(msg: "Key not found")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "accurascan_kyc",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Accura Scan",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -84,7 +84,6 @@
|
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">= 10.0.0"
|
|
86
86
|
},
|
|
87
|
-
"packageManager": "^yarn@1.22.15",
|
|
88
87
|
"jest": {
|
|
89
88
|
"preset": "react-native",
|
|
90
89
|
"modulePathIgnorePatterns": [
|