@regulaforensics/cordova-plugin-document-reader-api 8.1.139-rc → 8.1.141-rc
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/example/package.json +2 -2
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/JSONConstructor.kt +24 -7
- package/src/android/build.gradle +1 -1
- package/src/ios/RGLWConfig.m +14 -5
- package/www/DocumentReader.js +6 -0
package/example/package.json
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"author": "Regula Forensics Inc.",
|
|
14
14
|
"license": "commercial",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@regulaforensics/cordova-plugin-document-reader-api": "8.1.
|
|
17
|
-
"@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.1.
|
|
16
|
+
"@regulaforensics/cordova-plugin-document-reader-api": "8.1.141-rc",
|
|
17
|
+
"@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.1.370-rc",
|
|
18
18
|
"cordova-android": "13.0.0",
|
|
19
19
|
"cordova-ios": "7.1.1",
|
|
20
20
|
"cordova-plugin-add-swift-support": "2.0.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/cordova-plugin-document-reader-api",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.141-rc",
|
|
4
4
|
"description": "Cordova plugin for reading and validation of identification documents (API framework)",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "@regulaforensics/cordova-plugin-document-reader-api",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.1.
|
|
2
|
+
<plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.1.141-rc" xmlns="http://apache.org/cordova/ns/plugins/1.0">
|
|
3
3
|
<name>DocumentReaderApi</name>
|
|
4
4
|
<description>Cordova plugin Document reader api</description>
|
|
5
5
|
<license>commercial</license>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<source url="https://github.com/CocoaPods/Specs.git"/>
|
|
30
30
|
</config>
|
|
31
31
|
<pods>
|
|
32
|
-
<pod name="DocumentReaderStage" spec="8.1.
|
|
32
|
+
<pod name="DocumentReaderStage" spec="8.1.4730" />
|
|
33
33
|
</pods>
|
|
34
34
|
</podspec>
|
|
35
35
|
</platform>
|
|
@@ -8,6 +8,7 @@ import android.graphics.Bitmap
|
|
|
8
8
|
import android.graphics.Matrix
|
|
9
9
|
import android.graphics.Rect
|
|
10
10
|
import android.graphics.Typeface
|
|
11
|
+
import android.os.Build
|
|
11
12
|
import android.util.Pair
|
|
12
13
|
import com.regula.common.exception.RegulaException
|
|
13
14
|
import com.regula.documentreader.api.License
|
|
@@ -500,13 +501,29 @@ fun generateGlaresCheckParams(input: GlaresCheckParams?) = input?.let {
|
|
|
500
501
|
).toJson()
|
|
501
502
|
}
|
|
502
503
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
)
|
|
504
|
+
@SuppressLint("DiscouragedApi")
|
|
505
|
+
fun typefaceFromJSON(it: JSONObject): Pair<Typeface?, Int?> {
|
|
506
|
+
val font = try {
|
|
507
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
|
508
|
+
context.resources.getFont(
|
|
509
|
+
context.resources.getIdentifier(
|
|
510
|
+
it.getString("name"),
|
|
511
|
+
"font",
|
|
512
|
+
context.packageName
|
|
513
|
+
)
|
|
514
|
+
)
|
|
515
|
+
else throw Exception("")
|
|
516
|
+
} catch (_: Exception) {
|
|
517
|
+
Typeface.create(
|
|
518
|
+
it.getString("name"),
|
|
519
|
+
it.optInt("style", Typeface.NORMAL)
|
|
520
|
+
)
|
|
521
|
+
}
|
|
522
|
+
return Pair(
|
|
523
|
+
font,
|
|
524
|
+
if (it.has("size")) it.getInt("size") else null
|
|
525
|
+
)
|
|
526
|
+
}
|
|
510
527
|
|
|
511
528
|
fun generateTypeface(input: Typeface?, size: Int? = null) = input?.let {
|
|
512
529
|
mapOf(
|
package/src/android/build.gradle
CHANGED
package/src/ios/RGLWConfig.m
CHANGED
|
@@ -398,6 +398,7 @@
|
|
|
398
398
|
customization.status = [options valueForKey:@"status"];
|
|
399
399
|
if([options valueForKey:@"resultStatus"] != nil)
|
|
400
400
|
customization.resultStatus = [options valueForKey:@"resultStatus"];
|
|
401
|
+
if(options[@"multipageButtonText"]) customization.multipageButtonText = options[@"multipageButtonText"];
|
|
401
402
|
|
|
402
403
|
// Color
|
|
403
404
|
if([options valueForKey:@"cameraFrameDefaultColor"] != nil)
|
|
@@ -422,6 +423,7 @@
|
|
|
422
423
|
customization.cameraPreviewBackgroundColor = [self colorWithInt:[options valueForKey:@"cameraPreviewBackgroundColor"]];
|
|
423
424
|
if([options valueForKey:@"backgroundMaskColor"] != nil)
|
|
424
425
|
customization.backgroundMaskColor = [self colorWithInt:[options valueForKey:@"backgroundMaskColor"]];
|
|
426
|
+
if(options[@"multipageButtonTextColor"]) customization.multipageButtonTextColor = [self colorWithInt:options[@"multipageButtonTextColor"]];
|
|
425
427
|
|
|
426
428
|
// Float
|
|
427
429
|
if([options valueForKey:@"statusPositionMultiplier"] != nil)
|
|
@@ -444,9 +446,9 @@
|
|
|
444
446
|
customization.cameraFrameCornerRadius = [[options valueForKey:@"cameraFrameCornerRadius"] floatValue];
|
|
445
447
|
if([options valueForKey:@"livenessAnimationPositionMultiplier"] != nil)
|
|
446
448
|
customization.livenessAnimationPositionMultiplier = [[options valueForKey:@"livenessAnimationPositionMultiplier"] floatValue];
|
|
447
|
-
if(options[@"activityIndicatorPortraitPositionMultiplier"]) customization.activityIndicatorPortraitPositionMultiplier = [[
|
|
448
|
-
if(options[@"activityIndicatorLandscapePositionMultiplier"]) customization.activityIndicatorLandscapePositionMultiplier = [[
|
|
449
|
-
if(options[@"cameraPreviewVerticalPositionMultiplier"]) customization.previewLayerPositionMultiplier = [[
|
|
449
|
+
if(options[@"activityIndicatorPortraitPositionMultiplier"]) customization.activityIndicatorPortraitPositionMultiplier = [options[@"activityIndicatorPortraitPositionMultiplier"] floatValue];
|
|
450
|
+
if(options[@"activityIndicatorLandscapePositionMultiplier"]) customization.activityIndicatorLandscapePositionMultiplier = [options[@"activityIndicatorLandscapePositionMultiplier"] floatValue];
|
|
451
|
+
if(options[@"cameraPreviewVerticalPositionMultiplier"]) customization.previewLayerPositionMultiplier = [options[@"cameraPreviewVerticalPositionMultiplier"] floatValue];
|
|
450
452
|
|
|
451
453
|
// Drawable
|
|
452
454
|
if([options valueForKey:@"multipageAnimationFrontImage"] != nil)
|
|
@@ -479,6 +481,7 @@
|
|
|
479
481
|
customization.statusTextFont = [self UIFontFromJSON:[options valueForKey:@"statusTextFont"]];
|
|
480
482
|
if([options valueForKey:@"resultStatusTextFont"] != nil)
|
|
481
483
|
customization.resultStatusTextFont = [self UIFontFromJSON:[options valueForKey:@"resultStatusTextFont"]];
|
|
484
|
+
if(options[@"multipageButtonTextFont"]) customization.multipageButtonTextFont = [self UIFontFromJSON:options[@"multipageButtonTextFont"]];
|
|
482
485
|
|
|
483
486
|
// Custom
|
|
484
487
|
if([options valueForKey:@"customLabelStatus"] != nil)
|
|
@@ -529,6 +532,7 @@
|
|
|
529
532
|
// String
|
|
530
533
|
result[@"status"] = customization.status;
|
|
531
534
|
result[@"resultStatus"] = customization.resultStatus;
|
|
535
|
+
result[@"multipageButtonText"] = customization.multipageButtonText;
|
|
532
536
|
|
|
533
537
|
// Color
|
|
534
538
|
result[@"cameraFrameDefaultColor"] = [self intWithColor:customization.cameraFrameDefaultColor];
|
|
@@ -542,6 +546,7 @@
|
|
|
542
546
|
result[@"statusBackgroundColor"] = [self intWithColor:customization.statusBackgroundColor];
|
|
543
547
|
result[@"cameraPreviewBackgroundColor"] = [self intWithColor:customization.cameraPreviewBackgroundColor];
|
|
544
548
|
result[@"backgroundMaskColor"] = [self intWithColor:customization.backgroundMaskColor];
|
|
549
|
+
result[@"multipageButtonTextColor"] = [self intWithColor:customization.multipageButtonTextColor];
|
|
545
550
|
|
|
546
551
|
// Float
|
|
547
552
|
result[@"statusPositionMultiplier"] = [NSNumber numberWithFloat:customization.statusPositionMultiplier];
|
|
@@ -575,6 +580,7 @@
|
|
|
575
580
|
// Font
|
|
576
581
|
result[@"statusTextFont"] = [self generateUIFont:customization.statusTextFont];
|
|
577
582
|
result[@"resultStatusTextFont"] = [self generateUIFont:customization.resultStatusTextFont];
|
|
583
|
+
result[@"multipageButtonTextFont"] = [self generateUIFont:customization.multipageButtonTextFont];
|
|
578
584
|
|
|
579
585
|
// Custom
|
|
580
586
|
if(customization.customLabelStatus != nil) result[@"customLabelStatus"] = customization.customLabelStatus.string;
|
|
@@ -674,7 +680,7 @@
|
|
|
674
680
|
if([options valueForKey:@"signManagementAction"] != nil)
|
|
675
681
|
rfidScenario.signManagementAction = [[options valueForKey:@"signManagementAction"] integerValue];
|
|
676
682
|
if([options valueForKey:@"readingBuffer"] != nil)
|
|
677
|
-
rfidScenario.readingBuffer = [[options valueForKey:@"readingBuffer"]
|
|
683
|
+
rfidScenario.readingBuffer = [[options valueForKey:@"readingBuffer"] integerValue];
|
|
678
684
|
if([options valueForKey:@"onlineTAToSignDataType"] != nil)
|
|
679
685
|
rfidScenario.onlineTAToSignDataType = [[options valueForKey:@"onlineTAToSignDataType"] intValue];
|
|
680
686
|
if([options valueForKey:@"profilerType"] != nil)
|
|
@@ -1193,10 +1199,13 @@
|
|
|
1193
1199
|
}
|
|
1194
1200
|
|
|
1195
1201
|
+(UIFont*)UIFontFromJSON:(NSDictionary*)input {
|
|
1196
|
-
|
|
1202
|
+
UIFont* result = [UIFont fontWithName:[input valueForKey:@"name"] size:[[input valueForKey:@"size"] integerValue]];
|
|
1203
|
+
if (!result || !result.fontName) return nil;
|
|
1204
|
+
return result;
|
|
1197
1205
|
}
|
|
1198
1206
|
|
|
1199
1207
|
+(NSDictionary*)generateUIFont:(UIFont*)input {
|
|
1208
|
+
if (!input || !input.fontName) return nil;
|
|
1200
1209
|
return @{
|
|
1201
1210
|
@"name": input.fontName,
|
|
1202
1211
|
@"size": @(input.pointSize)
|
package/www/DocumentReader.js
CHANGED
|
@@ -2200,6 +2200,11 @@ const eProcessGLCommands = {
|
|
|
2200
2200
|
ePC_RFID_SetTCCParams: 12522,
|
|
2201
2201
|
}
|
|
2202
2202
|
|
|
2203
|
+
const eRFIDReadingBufferSize = {
|
|
2204
|
+
EXTENDED_LENGTH: 0,
|
|
2205
|
+
SINGLE_LENGTH: -1,
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2203
2208
|
const PKDResourceType = {
|
|
2204
2209
|
CERTIFICATE_PA: 0,
|
|
2205
2210
|
CERTIFICATE_TA: 1,
|
|
@@ -4286,6 +4291,7 @@ const Enum = {
|
|
|
4286
4291
|
eRPRM_FieldVerificationResult,
|
|
4287
4292
|
DocReaderAction,
|
|
4288
4293
|
eProcessGLCommands,
|
|
4294
|
+
eRFIDReadingBufferSize,
|
|
4289
4295
|
PKDResourceType,
|
|
4290
4296
|
eRFID_AuthenticationProcedureType,
|
|
4291
4297
|
DocumentReaderErrorCodes,
|