accurascan_kyc 1.2.3 → 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.
- package/accurascan-kyc.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/accurascankyc/AccurascanKycModule.java +76 -35
- package/android/src/main/java/com/accurascankyc/DownloadFontTask.java +56 -0
- package/android/src/main/java/com/accurascankyc/OcrActivity.java +75 -23
- package/android/src/main/java/com/accurascankyc/OcrResultActivity.java +9 -1
- 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.swift +85 -51
- package/ios/LVController.swift +1 -0
- package/ios/MainStoryboard_iPhone.storyboard +14 -12
- package/ios/ViewController.swift +108 -12
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/package.json +1 -1
package/accurascan-kyc.podspec
CHANGED
|
@@ -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.
|
|
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"
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
105
|
+
implementation 'com.github.accurascan:AccuraFaceMatch:3.2.2'
|
|
106
106
|
// for liveness
|
|
107
|
-
implementation 'com.github.accurascan:Liveness-Android:3.3.
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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);
|
|
169
|
+
// }
|
|
166
170
|
}
|
|
167
171
|
results.put("countries", countries);
|
|
168
172
|
}
|
|
@@ -216,12 +220,22 @@ 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");
|
|
223
|
-
|
|
224
|
-
actualAccuraErrorConfg.put("
|
|
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
|
+
|
|
225
239
|
actualAccuraErrorConfg.put("CameraScreen_Color","#80000000");
|
|
226
240
|
actualAccuraErrorConfg.put("CameraScreen_Border_Width",10);
|
|
227
241
|
actualAccuraErrorConfg.put("CameraScreen_CornerBorder_Enable",false);
|
|
@@ -285,6 +299,10 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
285
299
|
accuraTitleMsg.put(key, args.getJSONObject(2).get(key));
|
|
286
300
|
}
|
|
287
301
|
|
|
302
|
+
System.out.println("jhhjhjhjhjhjhjhj");
|
|
303
|
+
System.out.println(accuraErrorConfg.getString("fontStyle"));
|
|
304
|
+
|
|
305
|
+
System.out.println(accuraErrorConfg.getString("flipImage"));
|
|
288
306
|
|
|
289
307
|
OcrActivity.accuraErrorConfg = accuraErrorConfg;
|
|
290
308
|
OcrActivity.accuraTitleMsg = accuraTitleMsg;
|
|
@@ -435,26 +453,49 @@ public class AccurascanKycModule extends ReactContextBaseJavaModule {
|
|
|
435
453
|
JSONArray args = ReactNativeJSON.convertArrayToJson(argsNew);
|
|
436
454
|
|
|
437
455
|
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
456
|
|
|
456
|
-
|
|
457
|
-
|
|
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 {
|
|
479
|
+
Intent intent = new Intent(getCurrentActivity(),OcrActivity.class);
|
|
480
|
+
RecogType.MRZ.attachTo(intent);
|
|
481
|
+
OcrActivity.recogType = RecogType.MRZ;
|
|
482
|
+
if (mrzType.equals("passport_mrz")) {
|
|
483
|
+
MRZDocumentType.PASSPORT_MRZ.attachTo(intent);
|
|
484
|
+
}else if (mrzType.equals("id_mrz")){
|
|
485
|
+
MRZDocumentType.ID_CARD_MRZ.attachTo(intent);
|
|
486
|
+
}else if (mrzType.equals("visa_card")){
|
|
487
|
+
MRZDocumentType.VISA_MRZ.attachTo(intent);
|
|
488
|
+
}else{
|
|
489
|
+
MRZDocumentType.NONE.attachTo(intent);
|
|
490
|
+
}
|
|
491
|
+
OcrActivity.accuraErrorConfg = accuraErrorConfg;
|
|
492
|
+
OcrActivity.accuraTitleMsg = accuraTitleMsg;
|
|
493
|
+
intent.putExtra("card_name",mrzType);
|
|
494
|
+
intent.putExtra("app_orientation", Objects.requireNonNull(getCurrentActivity()).getRequestedOrientation());
|
|
495
|
+
onResult = callbackContext;
|
|
496
|
+
getCurrentActivity().startActivity(intent);
|
|
497
|
+
return true;
|
|
498
|
+
// }
|
|
458
499
|
}
|
|
459
500
|
|
|
460
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
|
|
|
@@ -100,15 +101,12 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
100
101
|
@Override
|
|
101
102
|
public void handleMessage(Message msg) {
|
|
102
103
|
OcrActivity activity = mActivity.get();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
AccuraLog.enableLogs(
|
|
106
|
-
AccuraLivenessLog.setDEBUG(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} catch (JSONException e) {
|
|
110
|
-
e.printStackTrace();
|
|
111
|
-
}
|
|
104
|
+
|
|
105
|
+
// if(accuraErrorConfg.getInt("enableLogs") == 1){
|
|
106
|
+
AccuraLog.enableLogs(false); // make sure to disable logs in release mode
|
|
107
|
+
AccuraLivenessLog.setDEBUG(false);
|
|
108
|
+
// AccuraLog.refreshLogfile(activity);
|
|
109
|
+
// }
|
|
112
110
|
|
|
113
111
|
|
|
114
112
|
if (activity != null) {
|
|
@@ -262,15 +260,24 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
262
260
|
});
|
|
263
261
|
|
|
264
262
|
try {
|
|
265
|
-
if (accuraErrorConfg.has("
|
|
266
|
-
tvTitle.setTextSize(accuraErrorConfg.getInt("
|
|
267
|
-
|
|
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"));
|
|
268
274
|
}else{
|
|
269
275
|
}
|
|
270
276
|
} catch (JSONException e) {
|
|
271
277
|
e.printStackTrace();
|
|
272
278
|
}
|
|
273
279
|
|
|
280
|
+
|
|
274
281
|
try {
|
|
275
282
|
borderFrame.setBorderColor(Color.parseColor(accuraErrorConfg.getString("CameraScreen_Frame_Color")));
|
|
276
283
|
borderFrame.setBorderWidth(accuraErrorConfg.getInt("CameraScreen_Border_Width"));
|
|
@@ -308,6 +315,18 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
308
315
|
e.printStackTrace();
|
|
309
316
|
}
|
|
310
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
|
+
|
|
311
330
|
viewLeft.setBackgroundColor(Color.parseColor(screenColor));
|
|
312
331
|
viewRight.setBackgroundColor(Color.parseColor(screenColor));
|
|
313
332
|
viewTop.setBackgroundColor(Color.parseColor(screenColor));
|
|
@@ -332,33 +351,60 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
332
351
|
// drawable.setCornerRadius(dp2Px(borderCornerRadius));
|
|
333
352
|
|
|
334
353
|
String titleTextColor = "#ffffff";
|
|
335
|
-
String
|
|
336
|
-
|
|
354
|
+
String errorTextColor = "#ffffff";
|
|
355
|
+
String messageTTextColor = "#ff0000";
|
|
356
|
+
String messageETextColor = "#ff0000";
|
|
337
357
|
try {
|
|
338
|
-
if (accuraErrorConfg.getString("
|
|
358
|
+
if (accuraErrorConfg.getString("CameraScreen_Heading_Text_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Heading_Text_Color")){
|
|
339
359
|
titleTextColor = "#ffffff";
|
|
340
360
|
}else{
|
|
341
|
-
titleTextColor = accuraErrorConfg.getString("
|
|
361
|
+
titleTextColor = accuraErrorConfg.getString("CameraScreen_Heading_Text_Color");
|
|
362
|
+
}
|
|
363
|
+
} catch (JSONException e) {
|
|
364
|
+
e.printStackTrace();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
try {
|
|
368
|
+
if (accuraErrorConfg.getString("CameraScreen_Error_Text_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Error_Text_Color")){
|
|
369
|
+
errorTextColor = "#ffffff";
|
|
370
|
+
}else{
|
|
371
|
+
errorTextColor = accuraErrorConfg.getString("CameraScreen_Error_Text_Color");
|
|
342
372
|
}
|
|
343
373
|
} catch (JSONException e) {
|
|
344
374
|
e.printStackTrace();
|
|
345
375
|
}
|
|
346
376
|
|
|
347
377
|
try {
|
|
348
|
-
if (accuraErrorConfg.getString("
|
|
349
|
-
|
|
378
|
+
if (accuraErrorConfg.getString("CameraScreen_Heading_Text_Border_Color").equals("") || !accuraErrorConfg.has("CameraScreen_Heading_Text_Border_Color")){
|
|
379
|
+
messageTTextColor = "#00000000";
|
|
350
380
|
}else{
|
|
351
|
-
|
|
381
|
+
messageTTextColor = accuraErrorConfg.getString("CameraScreen_Heading_Text_Border_Color");
|
|
352
382
|
}
|
|
353
383
|
} catch (JSONException e) {
|
|
354
384
|
e.printStackTrace();
|
|
355
385
|
}
|
|
356
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
|
+
|
|
357
403
|
tvTitle.setTextColor(Color.parseColor(titleTextColor));
|
|
358
|
-
tvTitle.setStroke(2, Color.parseColor(
|
|
404
|
+
tvTitle.setStroke(2, Color.parseColor(messageTTextColor), Paint.Join.BEVEL, 10);
|
|
359
405
|
|
|
360
|
-
tvScanMessage.setTextColor(Color.parseColor(
|
|
361
|
-
tvScanMessage.setStroke(2, Color.parseColor(
|
|
406
|
+
tvScanMessage.setTextColor(Color.parseColor(errorTextColor));
|
|
407
|
+
tvScanMessage.setStroke(2, Color.parseColor(messageETextColor), Paint.Join.ROUND, 10);
|
|
362
408
|
|
|
363
409
|
|
|
364
410
|
}
|
|
@@ -431,6 +477,12 @@ public class OcrActivity extends SensorsActivity implements OcrCallback {
|
|
|
431
477
|
//</editor-fold>
|
|
432
478
|
}
|
|
433
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
|
+
}
|
|
434
486
|
/**
|
|
435
487
|
* Override this method after scan complete to get data from document
|
|
436
488
|
*
|
|
@@ -429,7 +429,15 @@ public class OcrResultActivity extends Activity implements FaceCallback {
|
|
|
429
429
|
} catch (JSONException e) {
|
|
430
430
|
e.printStackTrace();
|
|
431
431
|
}
|
|
432
|
-
|
|
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
|
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
|
|
100
100
|
<ImageView
|
|
101
101
|
android:id="@+id/im_flip_image"
|
|
102
|
-
android:layout_width="
|
|
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="
|
|
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"
|
package/ios/AccurascanKyc.swift
CHANGED
|
@@ -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
|
-
|
|
47
|
-
"
|
|
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,
|
|
@@ -123,10 +133,10 @@ class AccurascanKyc: NSObject {
|
|
|
123
133
|
var results:[String: Any] = [:]
|
|
124
134
|
results["isValid"] = false
|
|
125
135
|
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
|
-
}
|
|
136
|
+
// DispatchQueue.main.async {
|
|
137
|
+
// self.accuraCameraWrapper?.setDefaultDialogs(true)
|
|
138
|
+
// self.accuraCameraWrapper?.showLogFile(true) // Set true to print log from KYC SDK
|
|
139
|
+
// }
|
|
130
140
|
|
|
131
141
|
// DispatchQueue.main.async {
|
|
132
142
|
DispatchQueue.main.async {
|
|
@@ -143,24 +153,28 @@ class AccurascanKyc: NSObject {
|
|
|
143
153
|
results["isBankCard"] = sdkModel!.isBankCardEnable
|
|
144
154
|
results["isMRZ"] = sdkModel!.isMRZEnable
|
|
145
155
|
|
|
156
|
+
|
|
146
157
|
let countryListStr = self.accuraCameraWrapper!.getOCRList();
|
|
147
158
|
for item in countryListStr ?? [] {
|
|
148
159
|
let cntry = item as! NSDictionary
|
|
149
160
|
var country:[String: Any] = [:]
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
// if cntry.value(forKey: "country_name") as? String == "Saint Kitts and Nevis" {
|
|
162
|
+
// results["isSchengen"] = true
|
|
163
|
+
// }else{
|
|
164
|
+
country["name"] = cntry.value(forKey: "country_name")
|
|
165
|
+
country["id"] = cntry.value(forKey: "country_id")
|
|
166
|
+
var cards:[[String: Any]] = []
|
|
167
|
+
for cd in cntry.value(forKey: "cards") as! NSArray {
|
|
168
|
+
let cardF = cd as! NSDictionary
|
|
169
|
+
var card:[String: Any] = [:]
|
|
170
|
+
card["name"] = cardF.value(forKey:"card_name")
|
|
171
|
+
card["id"] = cardF.value(forKey:"card_id")
|
|
172
|
+
card["type"] = cardF.value(forKey:"card_type")
|
|
173
|
+
cards.append(card)
|
|
174
|
+
}
|
|
175
|
+
country["cards"] = cards
|
|
176
|
+
countries.append(country)
|
|
177
|
+
// }
|
|
164
178
|
}
|
|
165
179
|
results["countries"] = countries
|
|
166
180
|
if sdkModel!.isBarcodeEnable {
|
|
@@ -273,16 +287,16 @@ class AccurascanKyc: NSObject {
|
|
|
273
287
|
}else{
|
|
274
288
|
self.accuraCameraWrapper?.setCameraFacing(.CAMERA_FACING_BACK)
|
|
275
289
|
}
|
|
276
|
-
if accuraconfigs["enableLogs"] != nil {
|
|
277
|
-
if accuraconfigs["enableLogs"] as? Int == 0 {
|
|
278
|
-
accuraCameraWrapper?.showLogFile(true)
|
|
279
|
-
accuraCameraWrapper?.setDefaultDialogs(true)
|
|
280
|
-
} else{
|
|
281
|
-
accuraCameraWrapper?.showLogFile(false)
|
|
282
|
-
}
|
|
283
|
-
} else{
|
|
284
|
-
accuraCameraWrapper?.showLogFile(false)
|
|
285
|
-
}
|
|
290
|
+
// if accuraconfigs["enableLogs"] != nil {
|
|
291
|
+
// if accuraconfigs["enableLogs"] as? Int == 0 {
|
|
292
|
+
// accuraCameraWrapper?.showLogFile(true)
|
|
293
|
+
// accuraCameraWrapper?.setDefaultDialogs(true)
|
|
294
|
+
// } else{
|
|
295
|
+
// accuraCameraWrapper?.showLogFile(false)
|
|
296
|
+
// }
|
|
297
|
+
// } else{
|
|
298
|
+
// accuraCameraWrapper?.showLogFile(false)
|
|
299
|
+
// }
|
|
286
300
|
// accuraCameraWrapper?.setCheckPhotoCopy(((configs!["isCheckPhotoCopy"] as? Bool)!))
|
|
287
301
|
// self.accuraCameraWrapper?.setCheckPhotoCopy(false, stCheckPhotoMessage: "")
|
|
288
302
|
// }
|
|
@@ -331,28 +345,48 @@ class AccurascanKyc: NSObject {
|
|
|
331
345
|
lvfm.faceImage = nil
|
|
332
346
|
self.goNativeCallBack = callback;
|
|
333
347
|
self.goNativeArgs = argsNew;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
viewController.
|
|
340
|
-
|
|
341
|
-
viewController.
|
|
342
|
-
|
|
343
|
-
viewController.
|
|
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{
|
|
367
|
+
DispatchQueue.main.async {
|
|
368
|
+
let viewController = UIStoryboard(name: "MainStoryboard_iPhone", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
|
|
369
|
+
if self.goNativeArgs[0] as! String == "passport_mrz" {
|
|
370
|
+
viewController.MRZDocType = 1
|
|
371
|
+
}else if self.goNativeArgs[0] as! String == "visa_card" {
|
|
372
|
+
viewController.MRZDocType = 3
|
|
373
|
+
}else if self.goNativeArgs[0] as! String == "id_mrz" {
|
|
374
|
+
viewController.MRZDocType = 2
|
|
375
|
+
}else{
|
|
376
|
+
viewController.MRZDocType = 0
|
|
377
|
+
}
|
|
378
|
+
viewController.callBack = self.goNativeCallBack
|
|
379
|
+
viewController.isCheckScanOCR = false
|
|
380
|
+
viewController.reactViewController = self.viewController
|
|
381
|
+
viewController.accuraTitleMsg = self.accuraTitleMsg
|
|
382
|
+
viewController.accuraErrorCode = self.accuraconfigs
|
|
383
|
+
viewController.modalPresentationStyle = .fullScreen
|
|
384
|
+
viewController.modalTransitionStyle = .coverVertical
|
|
385
|
+
// DispatchQueue.main.async {
|
|
386
|
+
// viewController.modalPresentationStyle = .fullScreen
|
|
387
|
+
self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
|
|
344
388
|
}
|
|
345
|
-
|
|
346
|
-
viewController.isCheckScanOCR = false
|
|
347
|
-
viewController.reactViewController = self.viewController
|
|
348
|
-
viewController.accuraTitleMsg = self.accuraTitleMsg
|
|
349
|
-
viewController.accuraErrorCode = self.accuraconfigs
|
|
350
|
-
viewController.modalPresentationStyle = .fullScreen
|
|
351
|
-
viewController.modalTransitionStyle = .coverVertical
|
|
352
|
-
// DispatchQueue.main.async {
|
|
353
|
-
// viewController.modalPresentationStyle = .fullScreen
|
|
354
|
-
self.getTopMostViewController()?.present(viewController, animated: true, completion: nil)
|
|
355
|
-
}
|
|
389
|
+
// }
|
|
356
390
|
}
|
|
357
391
|
|
|
358
392
|
@objc(startFaceMatch:callback:)
|
package/ios/LVController.swift
CHANGED
|
@@ -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
|
|
@@ -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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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"/>
|
package/ios/ViewController.swift
CHANGED
|
@@ -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["
|
|
159
|
-
.foregroundColor : UIColor(hexString: accuraErrorCode["
|
|
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["
|
|
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["
|
|
174
|
-
|
|
175
|
-
|
|
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 = []
|
|
@@ -1962,7 +2052,6 @@ extension ViewController: VideoCameraWrapperDelegate {
|
|
|
1962
2052
|
// mrzData["Document Type"] = shareScanningListing["passportType"]
|
|
1963
2053
|
}
|
|
1964
2054
|
}
|
|
1965
|
-
|
|
1966
2055
|
results["front_data"] = frontData
|
|
1967
2056
|
results["back_data"] = backData
|
|
1968
2057
|
results["mrz_data"] = mrzData
|
|
@@ -2783,3 +2872,10 @@ extension UIView {
|
|
|
2783
2872
|
|
|
2784
2873
|
}
|
|
2785
2874
|
|
|
2875
|
+
extension Data {
|
|
2876
|
+
mutating func append(_ string: String) {
|
|
2877
|
+
if let data = string.data(using: .utf8) {
|
|
2878
|
+
append(data)
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -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,
|
|
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":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -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":[]}
|