@regulaforensics/react-native-document-reader-api 9.11.953-rc → 9.11.956-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,7 +13,7 @@ Pod::Spec.new do |s|
13
13
 
14
14
  s.source = { :http => 'file:' + __dir__ }
15
15
  s.ios.deployment_target = '16.0'
16
- s.source_files = "ios/*.{h,m}"
17
- s.dependency 'DocumentReaderStage', '9.11.7404'
16
+ s.source_files = "ios/*.{swift,m}"
17
+ s.dependency 'DocumentReader', '9.10.7402'
18
18
  s.dependency 'React'
19
19
  end
@@ -30,7 +30,7 @@ dependencies {
30
30
  //noinspection GradleDynamicVersion
31
31
  implementation 'com.facebook.react:react-native:+'
32
32
  //noinspection GradleDependency
33
- implementation('com.regula.documentreader:api:9.10.13806') {
33
+ implementation('com.regula.documentreader:api:9.10.13800') {
34
34
  transitive = true
35
35
  }
36
36
  }
@@ -139,7 +139,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
139
139
  "finalizePackage" -> finalizePackage(callback)
140
140
  "finalizePackageWithFinalizeConfig" -> finalizePackageWithFinalizeConfig(callback, args(0))
141
141
  "endBackendTransaction" -> endBackendTransaction()
142
- "getTranslation" -> getTranslation(callback, args(0), args(1))
142
+ "getTranslation" -> getTranslation(callback, args(0), (args[1] as Number).toLong().toInt())
143
143
  else -> Unit
144
144
  }
145
145
 
@@ -510,7 +510,7 @@ fun encryptedContainers(
510
510
  raw: String
511
511
  ) = callback(fromRawResults(raw).encryptedContainers)
512
512
 
513
- fun getTranslation(callback: Callback, className: String, value: Int) = when (className) {
513
+ fun getTranslation(callback: Callback, className: String, value: Int) = if (value == -1) callback("Unknown") else when (className) {
514
514
  "RFIDErrorCodes" -> callback(eRFID_ErrorCodes.getTranslation(context, value))
515
515
  "LDSParsingErrorCodes" -> callback(eLDS_ParsingErrorCodes.getTranslation(context, value))
516
516
  "LDSParsingNotificationCodes" -> callback(eLDS_ParsingNotificationCodes.getTranslation(context, value))
@@ -25,7 +25,9 @@ import org.json.JSONObject
25
25
 
26
26
  var listenerCount = 0
27
27
 
28
- lateinit var args: JSONArray
28
+ // Args pass null arguments as nulls, null elements in arrays as nulls,
29
+ // but in maps keys with null values are removed.
30
+ lateinit var args: List<Any?>
29
31
  lateinit var binding: ReactContext
30
32
  val context: Context
31
33
  get() = binding.applicationContext
@@ -43,12 +45,12 @@ fun sendEvent(event: String, data: Any? = "") {
43
45
  }
44
46
 
45
47
  @Suppress("UNCHECKED_CAST")
46
- fun <T> argsNullable(index: Int): T? {
47
- val value = args[index]
48
- if (value is Double && value % 1 == 0.0) return value.toInt() as T
49
- if (value.toString() == "null") return null
50
- return value as T
51
- }
48
+ fun <T> argsNullable(index: Int): T? = when (val value = args[index]) {
49
+ is Map<*, *> -> value.toJson()
50
+ is List<*> -> value.toJson()
51
+ is Double -> if (value % 1 == 0.0) value.toInt() else value
52
+ else -> value
53
+ } as T?
52
54
 
53
55
  fun requestPermissions(activity: Activity, permissions: Array<String>, requestCode: Int) {
54
56
  (activity as PermissionAwareActivity).requestPermissions(permissions, requestCode) { code, perms, grantResults ->
@@ -91,7 +93,7 @@ class RNRegulaDocumentReaderModule(reactContext: ReactApplicationContext) : Reac
91
93
 
92
94
  @ReactMethod
93
95
  fun exec(moduleName: String, method: String, arguments: ReadableArray, success: com.facebook.react.bridge.Callback, error: com.facebook.react.bridge.Callback) {
94
- args = JSONArray(arguments.toArrayList())
96
+ args = arguments.toArrayList()
95
97
  try {
96
98
  methodCall(method) { data -> success(data.toSendable()) }
97
99
  } catch (error: Exception) {
@@ -17,7 +17,7 @@
17
17
  "react-native-radio-buttons-group": "3.1.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@babel/core": "^7.29.0",
20
+ "@babel/core": "^7.29.7",
21
21
  "@babel/runtime": "^7.28.4",
22
22
  "@react-native-community/cli": "20.2.0",
23
23
  "@react-native-community/cli-platform-android": "20.2.0",
@@ -7,8 +7,8 @@
7
7
  "ios": "react-native run-ios --no-packager"
8
8
  },
9
9
  "dependencies": {
10
- "@regulaforensics/react-native-document-reader-api": "9.11.953-rc",
11
- "@regulaforensics/react-native-document-reader-core-fullauthrfid": "9.11.3965-rc",
10
+ "@regulaforensics/react-native-document-reader-api": "9.11.956-rc",
11
+ "@regulaforensics/react-native-document-reader-core-fullauthrfid": "9.10.3891",
12
12
  "react": "19.3.1",
13
13
  "react-native": "0.88.1",
14
14
  "react-native-fs": "2.20.0",
@@ -16,11 +16,11 @@
16
16
  "react-native-radio-buttons-group": "3.1.0"
17
17
  },
18
18
  "overrides": {
19
- "fast-xml-parser": "^5.5.8",
20
- "js-yaml": "^4.1.1"
19
+ "fast-xml-parser": "^5.12.0",
20
+ "js-yaml": "^4.3.2"
21
21
  },
22
22
  "devDependencies": {
23
- "@babel/core": "^7.29.0",
23
+ "@babel/core": "^7.29.7",
24
24
  "@babel/runtime": "^7.28.4",
25
25
  "@react-native-community/cli": "20.2.0",
26
26
  "@react-native-community/cli-platform-android": "20.2.0",