@regulaforensics/cordova-plugin-document-reader-api 8.3.243-nightly → 8.3.263-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.
@@ -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.3.243-nightly",
17
- "@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.3.815-nightly",
16
+ "@regulaforensics/cordova-plugin-document-reader-api": "8.3.263-rc",
17
+ "@regulaforensics/cordova-plugin-document-reader-core-fullauthrfid": "8.4.942-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.3.243-nightly",
3
+ "version": "8.3.263-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.3.243-nightly" xmlns="http://apache.org/cordova/ns/plugins/1.0">
2
+ <plugin id="@regulaforensics/cordova-plugin-document-reader-api" version="8.3.263-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="DocumentReaderNightly" spec="8.3.5097" />
32
+ <pod name="DocumentReaderStage" spec="8.4.5263" />
33
33
  </pods>
34
34
  </podspec>
35
35
  </platform>
@@ -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
 
@@ -1,12 +1,12 @@
1
1
  repositories {
2
2
  maven {
3
- url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
3
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
4
4
  }
5
5
  }
6
6
 
7
7
  dependencies {
8
8
  //noinspection GradleDependency
9
- implementation ('com.regula.documentreader:api:8.3.11885'){
9
+ implementation ('com.regula.documentreader:api:8.3.11952'){
10
10
  transitive = true
11
11
  }
12
12
  }