@regulaforensics/react-native-document-reader-api 7.6.17-beta → 7.6.22-beta
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/RNDocumentReaderApi.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/regula/documentreader/BluetoothUtil.kt +3 -2
- package/android/src/main/java/com/regula/documentreader/JSONConstructor.kt +0 -8
- package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.kt +4 -12
- package/example/package.json +1 -1
- package/index.d.ts +1 -3
- package/index.js +1 -2
- package/ios/RGLWJSONConstructor.h +0 -5
- package/ios/RGLWJSONConstructor.m +0 -31
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -32,7 +32,7 @@ android {
|
|
|
32
32
|
rootProject.allprojects {
|
|
33
33
|
repositories {
|
|
34
34
|
maven {
|
|
35
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
35
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ dependencies {
|
|
|
41
41
|
//noinspection GradleDynamicVersion
|
|
42
42
|
implementation 'com.facebook.react:react-native:+'
|
|
43
43
|
//noinspection GradleDependency
|
|
44
|
-
implementation('com.regula.documentreader:api:7.5.
|
|
44
|
+
implementation('com.regula.documentreader:api:7.5.10445') {
|
|
45
45
|
transitive = true
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -22,6 +22,7 @@ import android.content.pm.PackageManager.PERMISSION_GRANTED
|
|
|
22
22
|
import android.os.Build
|
|
23
23
|
import android.os.IBinder
|
|
24
24
|
import android.provider.Settings
|
|
25
|
+
import androidx.core.app.ActivityCompat.requestPermissions
|
|
25
26
|
import androidx.core.content.ContextCompat.checkSelfPermission
|
|
26
27
|
import com.regula.documentreader.api.ble.BLEWrapper
|
|
27
28
|
import com.regula.documentreader.api.ble.BleWrapperCallback
|
|
@@ -152,10 +153,10 @@ fun deniedBluetoothPermission(
|
|
|
152
153
|
|
|
153
154
|
fun requestEnableBluetooth(activity: Activity) {
|
|
154
155
|
val enableIntent = Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)
|
|
155
|
-
startActivityForResult(
|
|
156
|
+
activity.startActivityForResult(enableIntent, INTENT_REQUEST_ENABLE_BLUETOOTH)
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
fun requestEnableLocationService(activity: Activity) {
|
|
159
160
|
val myIntent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)
|
|
160
|
-
startActivityForResult(
|
|
161
|
+
activity.startActivityForResult(myIntent, INTENT_REQUEST_ENABLE_LOCATION)
|
|
161
162
|
}
|
|
@@ -26,7 +26,6 @@ import com.regula.documentreader.api.enums.PDF417Info
|
|
|
26
26
|
import com.regula.documentreader.api.enums.eGraphicFieldType
|
|
27
27
|
import com.regula.documentreader.api.enums.eRFID_DataFile_Type
|
|
28
28
|
import com.regula.documentreader.api.enums.eRPRM_Lights
|
|
29
|
-
import com.regula.documentreader.api.listener.NetworkInterceptorListener
|
|
30
29
|
import com.regula.documentreader.api.params.AuthenticityParams
|
|
31
30
|
import com.regula.documentreader.api.params.BackendProcessingConfig
|
|
32
31
|
import com.regula.documentreader.api.params.BleDeviceConfig
|
|
@@ -107,8 +106,6 @@ import com.regula.documentreader.Convert.generateByteArray
|
|
|
107
106
|
import org.json.JSONArray
|
|
108
107
|
import org.json.JSONObject
|
|
109
108
|
|
|
110
|
-
val weakReferencesHolder = mutableListOf<Any>()
|
|
111
|
-
|
|
112
109
|
fun generateCompletion(action: Int, results: DocumentReaderResults?, error: RegulaException?, context: Context?) = object : JSONObject() { init {
|
|
113
110
|
put("action", action)
|
|
114
111
|
if (listOf(
|
|
@@ -369,11 +366,6 @@ fun onlineProcessingConfigFromJSON(temp: JSONObject?): OnlineProcessingConfig? {
|
|
|
369
366
|
if (input.has("url")) builder.setUrl(input.getString("url"))
|
|
370
367
|
if (input.has("imageCompressionQuality")) builder.setImageCompressionQuality(input.getDouble("imageCompressionQuality").toFloat())
|
|
371
368
|
if (input.has("processParams")) builder.setProcessParams(processParamFromJSON(input.getJSONObject("processParams")))
|
|
372
|
-
if (input.has("requestHeaders")) {
|
|
373
|
-
val listener = NetworkInterceptorListener { input.getJSONObject("requestHeaders").forEach { k, v -> it.setRequestProperty(k, v as String) } }
|
|
374
|
-
weakReferencesHolder.add(listener)
|
|
375
|
-
builder.setNetworkInterceptorListener(listener)
|
|
376
|
-
}
|
|
377
369
|
|
|
378
370
|
return builder.build()
|
|
379
371
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@file:Suppress("UNCHECKED_CAST"
|
|
1
|
+
@file:Suppress("UNCHECKED_CAST")
|
|
2
2
|
|
|
3
3
|
package com.regula.documentreader
|
|
4
4
|
|
|
@@ -21,7 +21,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
|
21
21
|
import com.facebook.react.bridge.ReactMethod
|
|
22
22
|
import com.facebook.react.bridge.ReadableArray
|
|
23
23
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
24
|
-
import com.facebook.react.modules.core.
|
|
24
|
+
import com.facebook.react.modules.core.PermissionListener
|
|
25
25
|
import com.regula.common.LocalizationCallbacks
|
|
26
26
|
import com.regula.documentreader.Convert.bitmapToBase64
|
|
27
27
|
import com.regula.documentreader.Convert.byteArrayFromBase64
|
|
@@ -56,7 +56,7 @@ import org.json.JSONArray
|
|
|
56
56
|
import org.json.JSONObject
|
|
57
57
|
|
|
58
58
|
@Suppress("unused", "UNUSED_PARAMETER")
|
|
59
|
-
class RNRegulaDocumentReaderModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(rc), ActivityEventListener {
|
|
59
|
+
class RNRegulaDocumentReaderModule(rc: ReactApplicationContext) : ReactContextBaseJavaModule(rc), ActivityEventListener, PermissionListener {
|
|
60
60
|
init {
|
|
61
61
|
reactContext = rc
|
|
62
62
|
reactContext.addActivityEventListener(this)
|
|
@@ -78,16 +78,8 @@ class RNRegulaDocumentReaderModule(rc: ReactApplicationContext) : ReactContextBa
|
|
|
78
78
|
override fun onActivityResult(activity: Activity, requestCode: Int, resultCode: Int, data: Intent?) {
|
|
79
79
|
onActivityResult(requestCode, resultCode, data)
|
|
80
80
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
fun requestPermissions(activity: Activity, permissions: Array<String>, requestCode: Int) {
|
|
84
|
-
(activity as PermissionAwareActivity).requestPermissions(permissions, requestCode) { code, perms, grantResults ->
|
|
85
|
-
onRequestPermissionsResult(code, perms, grantResults)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
81
|
|
|
89
|
-
fun
|
|
90
|
-
activity.startActivityForResult(intent, requestCode)
|
|
82
|
+
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) = com.regula.documentreader.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
|
91
83
|
}
|
|
92
84
|
|
|
93
85
|
fun sendEvent(event: String, data: Any? = "") {
|
package/example/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"test": "jest"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@regulaforensics/react-native-document-reader-api": "7.6.
|
|
13
|
+
"@regulaforensics/react-native-document-reader-api": "7.6.22-beta",
|
|
14
14
|
"@regulaforensics/react-native-document-reader-core-fullauthrfid": "7.5.893",
|
|
15
15
|
"react-native-progress": "5.0.0",
|
|
16
16
|
"react-native-radio-buttons-group": "3.0.5",
|
package/index.d.ts
CHANGED
|
@@ -1477,7 +1477,6 @@ export class OnlineProcessingConfig {
|
|
|
1477
1477
|
processParams?: ProcessParams
|
|
1478
1478
|
imageFormat?: number
|
|
1479
1479
|
imageCompressionQuality?: number
|
|
1480
|
-
requestHeaders?: Record<string, string>
|
|
1481
1480
|
|
|
1482
1481
|
static fromJson(jsonObject?: any): OnlineProcessingConfig | undefined {
|
|
1483
1482
|
if (jsonObject == null || jsonObject == undefined) return undefined
|
|
@@ -1488,7 +1487,6 @@ export class OnlineProcessingConfig {
|
|
|
1488
1487
|
result.processParams = ProcessParams.fromJson(jsonObject["processParams"])
|
|
1489
1488
|
result.imageFormat = jsonObject["imageFormat"]
|
|
1490
1489
|
result.imageCompressionQuality = jsonObject["imageCompressionQuality"]
|
|
1491
|
-
result.requestHeaders = jsonObject["requestHeaders"]
|
|
1492
1490
|
|
|
1493
1491
|
return result
|
|
1494
1492
|
}
|
|
@@ -5419,7 +5417,7 @@ export default class DocumentReader {
|
|
|
5419
5417
|
static addPKDCertificates(certificates: PKDCertificate[], successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
5420
5418
|
static clearPKDCertificates(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
5421
5419
|
static startNewSession(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
5422
|
-
static connectBluetoothDevice(
|
|
5420
|
+
static connectBluetoothDevice(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
5423
5421
|
static setLocalizationDictionary(dictionary: Record<string, string>, successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
5424
5422
|
static getLicense(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
|
5425
5423
|
static getAvailableScenarios(successCallback: (response: string) => void, errorCallback?: (error: string) => void): void
|
package/index.js
CHANGED
|
@@ -998,7 +998,6 @@ export class OnlineProcessingConfig {
|
|
|
998
998
|
result.processParams = ProcessParams.fromJson(jsonObject["processParams"])
|
|
999
999
|
result.imageFormat = jsonObject["imageFormat"]
|
|
1000
1000
|
result.imageCompressionQuality = jsonObject["imageCompressionQuality"]
|
|
1001
|
-
result.requestHeaders = jsonObject["requestHeaders"]
|
|
1002
1001
|
|
|
1003
1002
|
return result
|
|
1004
1003
|
}
|
|
@@ -4434,7 +4433,7 @@ DocumentReader.setTCCParams = (params, successCallback, errorCallback) => RNRegu
|
|
|
4434
4433
|
DocumentReader.addPKDCertificates = (certificates, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "addPKDCertificates", [certificates], successCallback, errorCallback)
|
|
4435
4434
|
DocumentReader.clearPKDCertificates = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "clearPKDCertificates", [], successCallback, errorCallback)
|
|
4436
4435
|
DocumentReader.startNewSession = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "startNewSession", [], successCallback, errorCallback)
|
|
4437
|
-
DocumentReader.connectBluetoothDevice = (
|
|
4436
|
+
DocumentReader.connectBluetoothDevice = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "connectBluetoothDevice", [], successCallback, errorCallback)
|
|
4438
4437
|
DocumentReader.setLocalizationDictionary = (dictionary, successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "setLocalizationDictionary", [dictionary], successCallback, errorCallback)
|
|
4439
4438
|
DocumentReader.getLicense = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "getLicense", [], successCallback, errorCallback)
|
|
4440
4439
|
DocumentReader.getAvailableScenarios = (successCallback, errorCallback) => RNRegulaDocumentReader.exec("DocumentReader", "getAvailableScenarios", [], successCallback, errorCallback)
|
|
@@ -184,9 +184,4 @@
|
|
|
184
184
|
+(NSDictionary* _Nullable)generateTransactionInfo:(RGLTransactionInfo* _Nullable)input;
|
|
185
185
|
|
|
186
186
|
@end
|
|
187
|
-
|
|
188
|
-
@interface RGLWRequestInterceptorProxy : NSObject <RGLURLRequestInterceptingDelegate>
|
|
189
|
-
- (instancetype _Nonnull)initWithHeaders:(NSDictionary*_Nonnull)headers;
|
|
190
|
-
@end
|
|
191
|
-
|
|
192
187
|
#endif
|
|
@@ -11,13 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
@implementation RGLWJSONConstructor
|
|
13
13
|
|
|
14
|
-
static NSMutableArray* weakReferencesHolder;
|
|
15
|
-
+(void) holdWeakReference:(id)reference {
|
|
16
|
-
if(!weakReferencesHolder)
|
|
17
|
-
weakReferencesHolder = [NSMutableArray new];
|
|
18
|
-
[weakReferencesHolder addObject:reference];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
14
|
+(NSString*)dictToString:(NSDictionary*)input {
|
|
22
15
|
if(input == nil) return nil;
|
|
23
16
|
return [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:input options:NSJSONWritingPrettyPrinted error:nil] encoding:NSUTF8StringEncoding];
|
|
@@ -413,11 +406,6 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
413
406
|
[RGLWConfig setProcessParams:[input valueForKey:@"processParams"] :params];
|
|
414
407
|
result.processParams = params;
|
|
415
408
|
}
|
|
416
|
-
if([input valueForKey:@"requestHeaders"] != nil) {
|
|
417
|
-
RGLWRequestInterceptorProxy* proxy = [[RGLWRequestInterceptorProxy alloc] initWithHeaders:[input valueForKey:@"requestHeaders"]];
|
|
418
|
-
[self holdWeakReference: proxy];
|
|
419
|
-
result.requestInterceptingDelegate = proxy;
|
|
420
|
-
}
|
|
421
409
|
|
|
422
410
|
return result;
|
|
423
411
|
}
|
|
@@ -2348,22 +2336,3 @@ static NSMutableArray* weakReferencesHolder;
|
|
|
2348
2336
|
}
|
|
2349
2337
|
|
|
2350
2338
|
@end
|
|
2351
|
-
|
|
2352
|
-
@implementation RGLWRequestInterceptorProxy {
|
|
2353
|
-
NSDictionary* _headers;
|
|
2354
|
-
}
|
|
2355
|
-
|
|
2356
|
-
- (instancetype)initWithHeaders:(NSDictionary*)headers {
|
|
2357
|
-
self = [super init];
|
|
2358
|
-
_headers = [headers copy];
|
|
2359
|
-
return self;
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
-(NSURLRequest*)interceptorPrepareRequest:(NSURLRequest*)request {
|
|
2363
|
-
NSMutableURLRequest *interceptedRequest = [request mutableCopy];
|
|
2364
|
-
for (NSString* key in _headers.allKeys)
|
|
2365
|
-
[interceptedRequest addValue:[_headers valueForKey:key] forHTTPHeaderField:key];
|
|
2366
|
-
return interceptedRequest;
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
@end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/react-native-document-reader-api",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.22-beta",
|
|
4
4
|
"description": "React Native module for reading and validation of identification documents (API framework)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|