@regulaforensics/document-reader 8.4.317-beta → 8.4.341-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.
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'RNDocumentReader'
8
- s.version = '8.4.317-beta'
8
+ s.version = '8.4.341-beta'
9
9
  s.summary = package['description']
10
10
  s.license = package['license']
11
11
 
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
16
16
  s.ios.deployment_target = '13.0'
17
17
  s.source_files = 'ios/**/*.{h,m}'
18
18
  s.exclude_files = [ 'ios/CVDDocumentReader.h', 'ios/CVDDocumentReader.m' ]
19
- s.dependency 'DocumentReader', '8.3.5094'
19
+ s.dependency 'DocumentReader', '8.3.5107'
20
20
  s.dependency 'React'
21
21
  end
@@ -7,6 +7,7 @@ import android.annotation.SuppressLint
7
7
  import android.app.Activity
8
8
  import android.bluetooth.BluetoothAdapter
9
9
  import android.content.ComponentName
10
+ import android.content.Context.BIND_AUTO_CREATE
10
11
  import android.content.Intent
11
12
  import android.content.ServiceConnection
12
13
  import android.content.pm.PackageManager.PERMISSION_GRANTED
@@ -31,9 +32,10 @@ const val INTENT_REQUEST_ENABLE_BLUETOOTH = 197
31
32
 
32
33
  @SuppressLint("StaticFieldLeak")
33
34
  var bluetooth: BLEWrapper? = null
35
+ lateinit var savedDeviceNameForPermissionResult: String
34
36
  lateinit var savedCallbackForPermissionResult: Callback
35
37
 
36
- fun connectBluetoothDevice(callback: Callback) {
38
+ fun connectBluetoothDevice(deviceName: String, callback: Callback) {
37
39
  if (bluetooth?.isConnected == true) {
38
40
  Log.e("REGULA", "Bluetooth device already connected, returning false")
39
41
  callback(false)
@@ -41,6 +43,7 @@ fun connectBluetoothDevice(callback: Callback) {
41
43
  }
42
44
 
43
45
  if (!isBluetoothSettingsReady(activity)) {
46
+ savedDeviceNameForPermissionResult = deviceName
44
47
  savedCallbackForPermissionResult = callback
45
48
  return
46
49
  }
@@ -55,6 +58,7 @@ fun connectBluetoothDevice(callback: Callback) {
55
58
  Timer().schedule(timeout, SEARCHING_TIMEOUT)
56
59
 
57
60
  val bleIntent = Intent(context, RegulaBleService::class.java)
61
+ bleIntent.putExtra(RegulaBleService.DEVICE_NAME, deviceName)
58
62
  context.startService(bleIntent)
59
63
  context.bindService(bleIntent, object : ServiceConnection {
60
64
  override fun onServiceConnected(name: ComponentName, service: IBinder) {
@@ -70,7 +74,7 @@ fun connectBluetoothDevice(callback: Callback) {
70
74
  }
71
75
 
72
76
  override fun onServiceDisconnected(name: ComponentName) {}
73
- }, 0)
77
+ }, BIND_AUTO_CREATE)
74
78
  }
75
79
 
76
80
  fun onRequestPermissionsResult(
@@ -83,7 +87,7 @@ fun onRequestPermissionsResult(
83
87
  savedCallbackForPermissionResult(false)
84
88
  return true
85
89
  }
86
- connectBluetoothDevice(savedCallbackForPermissionResult)
90
+ connectBluetoothDevice(savedDeviceNameForPermissionResult, savedCallbackForPermissionResult)
87
91
  return true
88
92
  }
89
93
 
@@ -95,7 +99,7 @@ fun onActivityResult(requestCode: Int, rc: Int, @Suppress("UNUSED_PARAMETER") da
95
99
 
96
100
  if (requestCode == INTENT_REQUEST_ENABLE_BLUETOOTH || requestCode == INTENT_REQUEST_ENABLE_LOCATION) {
97
101
  if (resultCode == Activity.RESULT_OK)
98
- connectBluetoothDevice(savedCallbackForPermissionResult)
102
+ connectBluetoothDevice(savedDeviceNameForPermissionResult, savedCallbackForPermissionResult)
99
103
  else
100
104
  savedCallbackForPermissionResult(false)
101
105
  return true
@@ -126,7 +130,7 @@ fun deniedBluetoothPermissions(): Array<String>? {
126
130
  result.addAll(deniedBluetoothPermission(BLUETOOTH_CONNECT))
127
131
  } else
128
132
  result.addAll(deniedBluetoothPermission(ACCESS_FINE_LOCATION))
129
- return result.let { if (it.size > 0) it.toTypedArray() else null }
133
+ return result.let { if (it.isNotEmpty()) it.toTypedArray() else null }
130
134
  }
131
135
 
132
136
  fun deniedBluetoothPermission(permission: String): Array<String> {
@@ -48,7 +48,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
48
48
  "getDocumentReaderIsReady" -> getDocumentReaderIsReady(callback)
49
49
  "getDocumentReaderStatus" -> getDocumentReaderStatus(callback)
50
50
  "getRfidSessionStatus" -> getRfidSessionStatus(callback)
51
- "setRfidSessionStatus" -> setRfidSessionStatus(argsNullable(0))
51
+ "setRfidSessionStatus" -> setRfidSessionStatus()
52
52
  "getTag" -> getTag(callback)
53
53
  "setTag" -> setTag(argsNullable(0))
54
54
  "getTenant" -> getTenant(callback)
@@ -90,7 +90,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
90
90
  "addPKDCertificates" -> addPKDCertificates(args(0))
91
91
  "clearPKDCertificates" -> clearPKDCertificates()
92
92
  "startNewSession" -> startNewSession()
93
- "connectBluetoothDevice" -> connectBluetoothDevice(callback)
93
+ "connectBluetoothDevice" -> connectBluetoothDevice(args(0), callback)
94
94
  "btDeviceRequestFlashing" -> btDeviceRequestFlashing()
95
95
  "btDeviceRequestFlashingFullIR" -> btDeviceRequestFlashingFullIR()
96
96
  "btDeviceRequestTurnOffAll" -> btDeviceRequestTurnOffAll()
@@ -148,7 +148,7 @@ fun getDocumentReaderStatus(callback: Callback) = callback(Instance().status)
148
148
 
149
149
  fun getRfidSessionStatus(iosOnly: Callback) = iosOnly(null)
150
150
 
151
- fun setRfidSessionStatus(iosOnly: String?) = Unit
151
+ fun setRfidSessionStatus() = Unit
152
152
 
153
153
  fun getTag(callback: Callback) = callback(Instance().tag)
154
154
 
@@ -6,9 +6,9 @@
6
6
  "android": "scripts/android.sh"
7
7
  },
8
8
  "dependencies": {
9
- "@regulaforensics/document-reader": "8.4.317-beta",
10
- "@regulaforensics/document-reader-core-fullauthrfid": "8.4.272-beta",
11
- "@regulaforensics/document-reader-btdevice": "8.4.16-beta",
9
+ "@regulaforensics/document-reader": "8.4.341-beta",
10
+ "@regulaforensics/document-reader-core-fullauthrfid": "8.4.325-beta",
11
+ "@regulaforensics/document-reader-btdevice": "8.4.20-beta",
12
12
  "@awesome-cordova-plugins/file": "6.6.0",
13
13
  "@awesome-cordova-plugins/camera": "6.6.0",
14
14
  "cordova-plugin-file": "8.1.3",
@@ -18,9 +18,9 @@
18
18
  "@awesome-cordova-plugins/file": "^8.1.0",
19
19
  "@ionic/angular": "^8.7.3",
20
20
  "@ionic/cordova-builders": "^12.3.0",
21
- "@regulaforensics/document-reader": "8.4.317-beta",
22
- "@regulaforensics/document-reader-core-fullauthrfid": "8.4.272-beta",
23
- "@regulaforensics/document-reader-btdevice": "8.4.16-beta",
21
+ "@regulaforensics/document-reader": "8.4.341-beta",
22
+ "@regulaforensics/document-reader-core-fullauthrfid": "8.4.325-beta",
23
+ "@regulaforensics/document-reader-btdevice": "8.4.20-beta",
24
24
  "cordova-android": "^14.0.1",
25
25
  "cordova-ios": "^7.1.1",
26
26
  "cordova-plugin-camera": "^8.0.0",
@@ -8,9 +8,9 @@
8
8
  "start": "expo start"
9
9
  },
10
10
  "dependencies": {
11
- "@regulaforensics/document-reader": "8.4.317-beta",
12
- "@regulaforensics/document-reader-core-fullauthrfid": "8.4.272-beta",
13
- "@regulaforensics/document-reader-btdevice": "8.4.16-beta",
11
+ "@regulaforensics/document-reader": "8.4.341-beta",
12
+ "@regulaforensics/document-reader-core-fullauthrfid": "8.4.325-beta",
13
+ "@regulaforensics/document-reader-btdevice": "8.4.20-beta",
14
14
  "react-native": "^0.81.4",
15
15
  "react-native-fs": "^2.20.0",
16
16
  "react-native-image-picker": "^8.2.1",
package/ios/RGLWMain.h CHANGED
@@ -32,5 +32,5 @@ static NSString* _Nonnull rfidOnRetryReadChipEvent = @"rfidOnRetryReadChipEvent"
32
32
  static NSString* _Nonnull paCertificateCompletionEvent = @"pa_certificate_completion";
33
33
  static NSString* _Nonnull taCertificateCompletionEvent = @"ta_certificate_completion";
34
34
  static NSString* _Nonnull taSignatureCompletionEvent = @"ta_signature_completion";
35
- static NSString* _Nonnull videoEncoderCompletionEvent = @"video_encoder_completion";
36
- static NSString* _Nonnull onCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
35
+ static NSString* _Nonnull drVideoEncoderCompletionEvent = @"video_encoder_completion";
36
+ static NSString* _Nonnull drOnCustomButtonTappedEvent = @"onCustomButtonTappedEvent";
package/ios/RGLWMain.m CHANGED
@@ -561,12 +561,12 @@ RGLWCallback savedCallbackForBluetoothResult;
561
561
 
562
562
  // RGLCustomizationActionDelegate
563
563
  - (void)onCustomButtonTappedWithTag:(NSInteger)tag {
564
- sendEvent(onCustomButtonTappedEvent, @(tag));
564
+ sendEvent(drOnCustomButtonTappedEvent, @(tag));
565
565
  }
566
566
 
567
567
  // RGLRecordScanningProcessDelegate
568
568
  - (void)didFinishRecordingToFile:(NSURL *)fileURL {
569
- sendEvent(videoEncoderCompletionEvent, fileURL.absoluteString);
569
+ sendEvent(drVideoEncoderCompletionEvent, fileURL.absoluteString);
570
570
  }
571
571
 
572
572
  - (void)didFailWithError:(NSError *)error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/document-reader",
3
- "version": "8.4.317-beta",
3
+ "version": "8.4.341-beta",
4
4
  "description": "This is an npm module for Regula Document Reader SDK. It allows you to read various kinds of identification documents using your phone's camera.",
5
5
  "main": "www/react-native/index.js",
6
6
  "module": "www/capacitor/index.js",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="@regulaforensics/document-reader" version="8.4.317-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
2
+ <plugin id="@regulaforensics/document-reader" version="8.4.341-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
3
  <name>DocumentReader</name>
4
4
  <description>Cordova plugin for Regula Document Reader SDK</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="DocumentReader" spec="8.3.5094" />
32
+ <pod name="DocumentReader" spec="8.3.5107" />
33
33
  </pods>
34
34
  </podspec>
35
35
  </platform>
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "..": {
15
15
  "name": "@regulaforensics/document-reader",
16
- "version": "8.4.317-beta",
16
+ "version": "8.4.341-beta",
17
17
  "dev": true,
18
18
  "license": "commercial"
19
19
  },
package/test/test.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { compare } from './utils'
2
- import { AccessControlProcedureType, Application, Attribute, AuthenticityCheck, AuthenticityElement, AuthenticityParams, AuthenticityResult, Authority, BackendProcessingConfig, BarcodeField, BarcodeResult, BytesData, CardProperties, CertificateChain, CertificateData, Comparison, Coordinate, Customization, CustomizationColors, CustomizationFonts, CustomizationImages, DataField, DocReaderException, DocReaderScenario, DocReaderVersion, DocumentsDatabase, DocumentType, EDLDataGroups, EIDDataGroups, DTCDataGroup, EPassportDataGroups, Extension, FaceApiParams, FaceApiSearchParams, File, FileData, Functionality, GlaresCheckParams, RFIDParams, GraphicField, GraphicResult, ImageInputData, ImageQA, ImageQuality, ImageQualityGroup, InitConfig, License, LivenessParams, OnlineProcessingConfig, OpticalStatus, PAAttribute, PAResourcesIssuer, PDF417Info, PKDCertificate, Position, PrepareProgress, ProcessParams, RecognizeConfig, Rect, Results, ResultsStatus, RFIDException, RFIDNotification, RFIDOrigin, RFIDScenario, RFIDSessionData, RFIDStatus, RFIDValidity, RFIDValue, ScannerConfig, SecurityObject, SecurityObjectCertificates, SignerInfo, Symbol, TAChallenge, TccParams, TextField, TextResult, TextSource, TransactionInfo, Validity, Value, VDSNCData } from '@regulaforensics/document-reader'
2
+ import { AccessControlProcedureType, Application, Attribute, AuthenticityCheck, AuthenticityElement, AuthenticityParams, AuthenticityResult, Authority, BackendProcessingConfig, BarcodeField, BarcodeResult, BytesData, CardProperties, CertificateChain, CertificateData, Comparison, Coordinate, Customization, CustomizationColors, CustomizationFonts, CustomizationImages, DataField, DocReaderException, DocReaderScenario, DocReaderVersion, DocumentsDatabase, DocumentType, EDLDataGroups, EIDDataGroups, DTCDataGroup, EPassportDataGroups, Extension, FaceApiParams, FaceApiSearchParams, File, FileData, Functionality, GlaresCheckParams, RFIDParams, GraphicField, GraphicResult, ImageInputData, ImageQA, ImageQuality, ImageQualityGroup, InitConfig, License, LivenessParams, OnlineProcessingConfig, OpticalStatus, PAAttribute, PAResourcesIssuer, PDF417Info, PKDCertificate, Position, PrepareProgress, ProcessParams, RecognizeConfig, Rect, Results, ResultsStatus, RFIDException, RFIDNotification, RFIDOrigin, RFIDScenario, RFIDSessionData, RFIDStatus, RFIDValidity, RFIDValue, ScannerConfig, SecurityObject, SecurityObjectCertificates, SignerInfo, Symbol, TAChallenge, TccParams, TextField, TextResult, TextSource, TransactionInfo, Validity, Value, VDSNCData } from '@regulaforensics/document-reader/www/capacitor'
3
3
  import { accessControlProcedureType, application, attribute, authenticityCheck, authenticityElement, authenticityParams, authenticityResult, authority, backendProcessingConfig, barcodeField, barcodeResult, bytesData, cardProperties, certificateChain, certificateData, comparison, coordinate, customization, customizationColors, customizationFonts, customizationImages, dataField, docReaderException, docReaderScenario, docReaderVersion, documentsDatabase, documentType, eDLDataGroups, eIDDataGroups, dtcDataGroup, ePassportDataGroups, extension, faceApiParams, faceApiSearchParams, file, fileData, functionality, glaresCheckParams, rfidParams, graphicField, graphicResult, imageInputData, imageQA, imageQuality, imageQualityGroup, initConfig, license, livenessParams, onlineProcessingConfig, opticalStatus, paAttribute, paResourcesIssuer, pdf417Info, pkdCertificate, position, prepareProgress, processParams, recognizeConfig, recognizeConfig2, rect, results, resultsStatus, rfidException, rfidNotification, rfidOrigin, rfidScenario, rfidSessionData, rfidStatus, rfidValidity, rfidValue, scannerConfig, securityObject, securityObjectCertificates, signerInfo, symbol, taChallenge, tccParams, textField, textResult, textSource, transactionInfo, validity, value, vdsncData } from './json'
4
4
 
5
5
  compare('initConfig', initConfig, InitConfig.fromJson)
@@ -260,7 +260,6 @@ export class DocumentReader {
260
260
  }
261
261
 
262
262
  async connectBluetoothDevice(deviceName) {
263
- this.functionality.btDeviceName = deviceName;
264
263
  return await exec("connectBluetoothDevice", [deviceName]);
265
264
  }
266
265
 
package/www/cordova.js CHANGED
@@ -906,7 +906,6 @@ class DocumentReader {
906
906
  }
907
907
 
908
908
  async connectBluetoothDevice(deviceName) {
909
- this.functionality.btDeviceName = deviceName;
910
909
  return await (0,_internal_bridge__WEBPACK_IMPORTED_MODULE_0__.exec)("connectBluetoothDevice", [deviceName]);
911
910
  }
912
911
 
@@ -260,7 +260,6 @@ export class DocumentReader {
260
260
  }
261
261
 
262
262
  async connectBluetoothDevice(deviceName) {
263
- this.functionality.btDeviceName = deviceName;
264
263
  return await exec("connectBluetoothDevice", [deviceName]);
265
264
  }
266
265