@regulaforensics/react-native-document-reader-api 8.3.263 → 8.4.1-nightly
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/README.md +4 -0
- package/RNDocumentReaderApi.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/regula/plugin/documentreader/BluetoothUtil.kt +9 -5
- package/android/src/main/java/com/regula/plugin/documentreader/Config.kt +20 -0
- package/android/src/main/java/com/regula/plugin/documentreader/JSONConstructor.kt +3 -0
- package/android/src/main/java/com/regula/plugin/documentreader/Main.kt +11 -8
- package/example/App.tsx +4 -3
- package/example/android/app/build.gradle +3 -3
- package/example/android/build.gradle +4 -4
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradlew +1 -1
- package/example/ios/DocumentReader.xcodeproj/project.pbxproj +17 -2
- package/example/package-lock.json +1160 -1674
- package/example/package.json +20 -20
- package/index.d.ts +37 -0
- package/index.js +26 -0
- package/ios/RGLWConfig.m +10 -9
- package/ios/RGLWJSONConstructor.m +3 -0
- package/ios/RGLWMain.h +2 -2
- package/ios/RGLWMain.m +2 -2
- package/ios/RNRegulaDocumentReader.m +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Deprecated
|
|
2
|
+
|
|
3
|
+
Introduced a new unified [NPM package](https://www.npmjs.com/package/@regulaforensics/document-reader) that supports React, Ionic, and Cordova wrappers in a single distribution. The individual packages for each wrapper are now deprecated and will only be supported for a few upcoming releases before being removed in future versions. We’ll provide advance notice prior to their removal. Follow the Migration Guide for detailed steps to transition to the new unified package.
|
|
4
|
+
|
|
1
5
|
# Regula Document Reader SDK for React Native
|
|
2
6
|
|
|
3
7
|
Regula Document Reader SDK allows you to read various kinds of identification documents, passports, driving licenses, ID cards, etc. All processing is performed completely _**offline**_ on your device. No any data leaving your device.
|
|
@@ -14,6 +14,6 @@ Pod::Spec.new do |s|
|
|
|
14
14
|
s.source = { :http => 'file:' + __dir__ }
|
|
15
15
|
s.ios.deployment_target = '13.0'
|
|
16
16
|
s.source_files = "ios/*.{h,m}"
|
|
17
|
-
s.dependency '
|
|
17
|
+
s.dependency 'DocumentReaderNightly', '8.5.5556'
|
|
18
18
|
s.dependency 'React'
|
|
19
19
|
end
|
package/android/build.gradle
CHANGED
|
@@ -20,7 +20,7 @@ android {
|
|
|
20
20
|
rootProject.allprojects {
|
|
21
21
|
repositories {
|
|
22
22
|
maven {
|
|
23
|
-
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
23
|
+
url "https://maven.regulaforensics.com/RegulaDocumentReader/Nightly"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ dependencies {
|
|
|
29
29
|
//noinspection GradleDynamicVersion
|
|
30
30
|
implementation 'com.facebook.react:react-native:+'
|
|
31
31
|
//noinspection GradleDependency
|
|
32
|
-
implementation('com.regula.documentreader:api:8.
|
|
32
|
+
implementation('com.regula.documentreader:api:8.5.12101') {
|
|
33
33
|
transitive = true
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -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
|
-
},
|
|
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.
|
|
133
|
+
return result.let { if (it.isNotEmpty()) it.toTypedArray() else null }
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
fun deniedBluetoothPermission(permission: String): Array<String> {
|
|
@@ -47,6 +47,7 @@ fun setFunctionality(config: Functionality, input: JSONObject) = input.forEach {
|
|
|
47
47
|
"recordScanningProcess" -> editor.setDoRecordProcessingVideo(v as Boolean)
|
|
48
48
|
"manualMultipageMode" -> editor.setManualMultipageMode(v as Boolean)
|
|
49
49
|
"torchTurnedOn" -> editor.setTorchTurnedOn(v as Boolean)
|
|
50
|
+
"preventScreenRecording" -> editor.setPreventScreenRecording(v as Boolean)
|
|
50
51
|
"showCaptureButtonDelayFromDetect" -> editor.setShowCaptureButtonDelayFromDetect(v.toLong())
|
|
51
52
|
"showCaptureButtonDelayFromStart" -> editor.setShowCaptureButtonDelayFromStart(v.toLong())
|
|
52
53
|
"orientation" -> editor.setOrientation(v.toInt())
|
|
@@ -82,6 +83,7 @@ fun getFunctionality(input: Functionality) = mapOf(
|
|
|
82
83
|
"recordScanningProcess" to input.doRecordProcessingVideo(),
|
|
83
84
|
"manualMultipageMode" to input.isManualMultipageMode,
|
|
84
85
|
"torchTurnedOn" to input.isTorchTurnedOn,
|
|
86
|
+
"preventScreenRecording" to input.doPreventScreenRecording(),
|
|
85
87
|
"showCaptureButtonDelayFromDetect" to input.showCaptureButtonDelayFromDetect,
|
|
86
88
|
"showCaptureButtonDelayFromStart" to input.showCaptureButtonDelayFromStart,
|
|
87
89
|
"orientation" to input.orientation,
|
|
@@ -141,6 +143,7 @@ fun setProcessParams(processParams: ProcessParam, opts: JSONObject) = opts.forEa
|
|
|
141
143
|
"generateAlpha2Codes" -> processParams.generateAlpha2Codes = v as Boolean
|
|
142
144
|
"disableAuthResolutionFilter" -> processParams.disableAuthResolutionFilter = v as Boolean
|
|
143
145
|
"strictSecurityChecks" -> processParams.strictSecurityChecks = v as Boolean
|
|
146
|
+
"returnTransliteratedFields" -> processParams.returnTransliteratedFields = v as Boolean
|
|
144
147
|
"measureSystem" -> processParams.measureSystem = v.toInt()
|
|
145
148
|
"barcodeParserType" -> processParams.barcodeParserType = v.toInt()
|
|
146
149
|
"perspectiveAngle" -> processParams.perspectiveAngle = v.toInt()
|
|
@@ -227,6 +230,7 @@ fun getProcessParams(processParams: ProcessParam) = mapOf(
|
|
|
227
230
|
"generateAlpha2Codes" to processParams.generateAlpha2Codes,
|
|
228
231
|
"disableAuthResolutionFilter" to processParams.disableAuthResolutionFilter,
|
|
229
232
|
"strictSecurityChecks" to processParams.strictSecurityChecks,
|
|
233
|
+
"returnTransliteratedFields" to processParams.returnTransliteratedFields,
|
|
230
234
|
"measureSystem" to processParams.measureSystem,
|
|
231
235
|
"barcodeParserType" to processParams.barcodeParserType,
|
|
232
236
|
"perspectiveAngle" to processParams.perspectiveAngle,
|
|
@@ -752,6 +756,10 @@ fun setColors(input: ParamsCustomization.CustomizationEditor, opts: JSONObject)
|
|
|
752
756
|
"rfidProcessingScreenProgressBarBackground" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND, value)
|
|
753
757
|
"rfidProcessingScreenResultLabelText" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT, value)
|
|
754
758
|
"rfidProcessingScreenLoadingBar" -> input.setColor(CustomizationColor.RFID_PROCESSING_SCREEN_LOADING_BAR, value)
|
|
759
|
+
"rfidEnableNfcTitleText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_TITLE_TEXT, value)
|
|
760
|
+
"rfidEnableNfcDescriptionText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_DESCRIPTION_TEXT, value)
|
|
761
|
+
"rfidEnableNfcButtonText" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_TEXT, value)
|
|
762
|
+
"rfidEnableNfcButtonBackground" -> input.setColor(CustomizationColor.RFID_ENABLE_NFC_BUTTON_BACKGROUND, value)
|
|
755
763
|
}
|
|
756
764
|
}
|
|
757
765
|
|
|
@@ -764,6 +772,10 @@ fun getColors(input: Map<CustomizationColor, Long>) = mapOf(
|
|
|
764
772
|
"rfidProcessingScreenProgressBarBackground" to input[CustomizationColor.RFID_PROCESSING_SCREEN_PROGRESS_BAR_BACKGROUND],
|
|
765
773
|
"rfidProcessingScreenResultLabelText" to input[CustomizationColor.RFID_PROCESSING_SCREEN_RESULT_LABEL_TEXT],
|
|
766
774
|
"rfidProcessingScreenLoadingBar" to input[CustomizationColor.RFID_PROCESSING_SCREEN_LOADING_BAR],
|
|
775
|
+
"rfidEnableNfcTitleText" to input[CustomizationColor.RFID_ENABLE_NFC_TITLE_TEXT],
|
|
776
|
+
"rfidEnableNfcDescriptionText" to input[CustomizationColor.RFID_ENABLE_NFC_DESCRIPTION_TEXT],
|
|
777
|
+
"rfidEnableNfcButtonText" to input[CustomizationColor.RFID_ENABLE_NFC_BUTTON_TEXT],
|
|
778
|
+
"rfidEnableNfcButtonBackground" to input[CustomizationColor.RFID_ENABLE_NFC_BUTTON_BACKGROUND],
|
|
767
779
|
).toJson()
|
|
768
780
|
|
|
769
781
|
fun setFonts(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, value ->
|
|
@@ -771,6 +783,9 @@ fun setFonts(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) =
|
|
|
771
783
|
"rfidProcessingScreenHintLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_HINT_LABEL.setFont(input, value)
|
|
772
784
|
"rfidProcessingScreenProgressLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_PROGRESS_LABEL.setFont(input, value)
|
|
773
785
|
"rfidProcessingScreenResultLabel" -> CustomizationFont.RFID_PROCESSING_SCREEN_RESULT_LABEL.setFont(input, value)
|
|
786
|
+
"rfidEnableNfcTitleText" -> CustomizationFont.RFID_ENABLE_NFC_TITLE_TEXT.setFont(input, value)
|
|
787
|
+
"rfidEnableNfcDescriptionText" -> CustomizationFont.RFID_ENABLE_NFC_DESCRIPTION_TEXT.setFont(input, value)
|
|
788
|
+
"rfidEnableNfcButtonText" -> CustomizationFont.RFID_ENABLE_NFC_BUTTON_TEXT.setFont(input, value)
|
|
774
789
|
}
|
|
775
790
|
}
|
|
776
791
|
|
|
@@ -778,16 +793,21 @@ fun getFonts(fonts: Map<CustomizationFont, Typeface>, sizes: Map<CustomizationFo
|
|
|
778
793
|
"rfidProcessingScreenHintLabel" to CustomizationFont.RFID_PROCESSING_SCREEN_HINT_LABEL.getFont(fonts, sizes),
|
|
779
794
|
"rfidProcessingScreenProgressLabel" to CustomizationFont.RFID_PROCESSING_SCREEN_PROGRESS_LABEL.getFont(fonts, sizes),
|
|
780
795
|
"rfidProcessingScreenResultLabel" to CustomizationFont.RFID_PROCESSING_SCREEN_RESULT_LABEL.getFont(fonts, sizes),
|
|
796
|
+
"rfidEnableNfcTitleText" to CustomizationFont.RFID_ENABLE_NFC_TITLE_TEXT.getFont(fonts, sizes),
|
|
797
|
+
"rfidEnableNfcDescriptionText" to CustomizationFont.RFID_ENABLE_NFC_DESCRIPTION_TEXT.getFont(fonts, sizes),
|
|
798
|
+
"rfidEnableNfcButtonText" to CustomizationFont.RFID_ENABLE_NFC_BUTTON_TEXT.getFont(fonts, sizes),
|
|
781
799
|
).toJson()
|
|
782
800
|
|
|
783
801
|
fun setImages(input: ParamsCustomization.CustomizationEditor, opts: JSONObject) = opts.forEach { key, v ->
|
|
784
802
|
when (key) {
|
|
785
803
|
"rfidProcessingScreenFailureImage" -> input.setImage(CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE, v.toDrawable())
|
|
804
|
+
"rfidEnableNfcImage" -> input.setImage(CustomizationImage.RFID_ENABLE_NFC_IMAGE, v.toDrawable())
|
|
786
805
|
}
|
|
787
806
|
}
|
|
788
807
|
|
|
789
808
|
fun getImages(input: Map<CustomizationImage, Drawable>) = mapOf(
|
|
790
809
|
"rfidProcessingScreenFailureImage" to (input[CustomizationImage.RFID_PROCESSING_SCREEN_FAILURE_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_ic_error)).toBase64(),
|
|
810
|
+
"rfidEnableNfcImage" to (input[CustomizationImage.RFID_ENABLE_NFC_IMAGE] ?: ContextCompat.getDrawable(context, com.regula.documentreader.api.R.drawable.reg_enable_nfc)).toBase64(),
|
|
791
811
|
).toJson()
|
|
792
812
|
|
|
793
813
|
fun CustomizationFont.getFont(fonts: Map<CustomizationFont, Typeface>, sizes: Map<CustomizationFont, Int>) =
|
|
@@ -192,6 +192,7 @@ fun initConfigFromJSON(input: JSONObject) = input.let {
|
|
|
192
192
|
|
|
193
193
|
if (it.has("licenseUpdate")) result.setLicenseUpdate(it.getBoolean("licenseUpdate"))
|
|
194
194
|
if (it.has("delayedNNLoad")) result.isDelayedNNLoad = it.getBoolean("delayedNNLoad")
|
|
195
|
+
result.licenseUpdateTimeout = it.getDoubleOrNull("licenseUpdateTimeout")
|
|
195
196
|
result.blackList = it.getJSONObjectOrNull("blackList")
|
|
196
197
|
result
|
|
197
198
|
}
|
|
@@ -203,6 +204,7 @@ fun generateInitConfig(input: DocReaderConfig?) = input?.let {
|
|
|
203
204
|
"databasePath" to it.customDbPath,
|
|
204
205
|
"licenseUpdate" to it.isLicenseUpdate,
|
|
205
206
|
"delayedNNLoad" to it.isDelayedNNLoad,
|
|
207
|
+
"licenseUpdateTimeout" to it.licenseUpdateTimeout,
|
|
206
208
|
"blackList" to it.blackList
|
|
207
209
|
).toJson()
|
|
208
210
|
}
|
|
@@ -213,6 +215,7 @@ fun initBleDeviceConfigFromJSON(input: JSONObject) = input.let {
|
|
|
213
215
|
|
|
214
216
|
if (it.has("licenseUpdate")) result.setLicenseUpdate(it.getBoolean("licenseUpdate"))
|
|
215
217
|
if (it.has("delayedNNLoad")) result.isDelayedNNLoad = it.getBoolean("delayedNNLoad")
|
|
218
|
+
result.licenseUpdateTimeout = it.getDoubleOrNull("licenseUpdateTimeout")
|
|
216
219
|
result.blackList = it.getJSONObjectOrNull("blackList")
|
|
217
220
|
result
|
|
218
221
|
}
|
|
@@ -16,6 +16,7 @@ import com.regula.documentreader.api.DocumentReader.Instance
|
|
|
16
16
|
import com.regula.documentreader.api.completions.IDocumentReaderCompletion
|
|
17
17
|
import com.regula.documentreader.api.completions.IDocumentReaderInitCompletion
|
|
18
18
|
import com.regula.documentreader.api.completions.IDocumentReaderPrepareDbCompletion
|
|
19
|
+
import com.regula.documentreader.api.completions.IVideoEncoderCompletion
|
|
19
20
|
import com.regula.documentreader.api.completions.model.PrepareProgress
|
|
20
21
|
import com.regula.documentreader.api.completions.rfid.IRfidPKDCertificateCompletion
|
|
21
22
|
import com.regula.documentreader.api.completions.rfid.IRfidReaderCompletion
|
|
@@ -44,11 +45,11 @@ import org.json.JSONObject
|
|
|
44
45
|
import com.regula.plugin.documentreader.Convert.toBase64
|
|
45
46
|
import com.regula.plugin.documentreader.Convert.toByteArray
|
|
46
47
|
|
|
47
|
-
fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
48
|
+
fun methodCall(method: String, callback: (Any?) -> Unit): Any? = when (method) {
|
|
48
49
|
"getDocumentReaderIsReady" -> getDocumentReaderIsReady(callback)
|
|
49
50
|
"getDocumentReaderStatus" -> getDocumentReaderStatus(callback)
|
|
50
51
|
"getRfidSessionStatus" -> getRfidSessionStatus(callback)
|
|
51
|
-
"setRfidSessionStatus" -> setRfidSessionStatus(
|
|
52
|
+
"setRfidSessionStatus" -> setRfidSessionStatus()
|
|
52
53
|
"getTag" -> getTag(callback)
|
|
53
54
|
"setTag" -> setTag(argsNullable(0))
|
|
54
55
|
"getTenant" -> getTenant(callback)
|
|
@@ -90,7 +91,7 @@ fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
|
|
|
90
91
|
"addPKDCertificates" -> addPKDCertificates(args(0))
|
|
91
92
|
"clearPKDCertificates" -> clearPKDCertificates()
|
|
92
93
|
"startNewSession" -> startNewSession()
|
|
93
|
-
"connectBluetoothDevice" -> connectBluetoothDevice(callback)
|
|
94
|
+
"connectBluetoothDevice" -> connectBluetoothDevice(args(0), callback)
|
|
94
95
|
"btDeviceRequestFlashing" -> btDeviceRequestFlashing()
|
|
95
96
|
"btDeviceRequestFlashingFullIR" -> btDeviceRequestFlashingFullIR()
|
|
96
97
|
"btDeviceRequestTurnOffAll" -> btDeviceRequestTurnOffAll()
|
|
@@ -148,7 +149,7 @@ fun getDocumentReaderStatus(callback: Callback) = callback(Instance().status)
|
|
|
148
149
|
|
|
149
150
|
fun getRfidSessionStatus(iosOnly: Callback) = iosOnly(null)
|
|
150
151
|
|
|
151
|
-
fun setRfidSessionStatus(
|
|
152
|
+
fun setRfidSessionStatus() = Unit
|
|
152
153
|
|
|
153
154
|
fun getTag(callback: Callback) = callback(Instance().tag)
|
|
154
155
|
|
|
@@ -219,12 +220,12 @@ fun checkDatabaseUpdate(callback: Callback, databaseID: String) = Instance().che
|
|
|
219
220
|
@Suppress("DEPRECATION")
|
|
220
221
|
fun scan(config: JSONObject) {
|
|
221
222
|
stopBackgroundRFID()
|
|
222
|
-
Instance().showScanner(
|
|
223
|
+
Instance().showScanner(activity, scannerConfigFromJSON(config), IDocumentReaderCompletion(completion))
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
fun startScanner(config: JSONObject) {
|
|
226
227
|
stopBackgroundRFID()
|
|
227
|
-
Instance().startScanner(
|
|
228
|
+
Instance().startScanner(activity, scannerConfigFromJSON(config), IDocumentReaderCompletion(completion))
|
|
228
229
|
}
|
|
229
230
|
|
|
230
231
|
fun recognize(config: JSONObject) {
|
|
@@ -243,7 +244,7 @@ fun startRFIDReader(onRequestPACertificates: Boolean, onRequestTACertificates: B
|
|
|
243
244
|
onRequestTACertificates,
|
|
244
245
|
onRequestTASignature
|
|
245
246
|
)
|
|
246
|
-
Instance().startRFIDReader(
|
|
247
|
+
Instance().startRFIDReader(activity, rfidReaderCompletion, requestType.getRfidReaderRequest())
|
|
247
248
|
}
|
|
248
249
|
|
|
249
250
|
fun readRFID(onRequestPACertificates: Boolean, onRequestTACertificates: Boolean, onRequestTASignature: Boolean) {
|
|
@@ -476,7 +477,8 @@ fun prepareCompletion(callback: Callback) = object : IDocumentReaderPrepareDbCom
|
|
|
476
477
|
|
|
477
478
|
fun initCompletion(callback: Callback) = IDocumentReaderInitCompletion { success, error ->
|
|
478
479
|
if (success) {
|
|
479
|
-
|
|
480
|
+
videoEncoderCompletion = IVideoEncoderCompletion { _, file -> sendEvent(videoEncoderCompletionEvent, file.path) }
|
|
481
|
+
Instance().setVideoEncoderCompletion(videoEncoderCompletion)
|
|
480
482
|
Instance().setOnClickListener { sendEvent(onCustomButtonTappedEvent, it.tag) }
|
|
481
483
|
}
|
|
482
484
|
callback(generateSuccessCompletion(success, error))
|
|
@@ -577,3 +579,4 @@ fun stopBackgroundRFID() {
|
|
|
577
579
|
|
|
578
580
|
// Weak references
|
|
579
581
|
lateinit var localizationCallbacks: LocalizationCallbacks
|
|
582
|
+
lateinit var videoEncoderCompletion: IVideoEncoderCompletion
|
package/example/App.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { ScrollView, StyleSheet, Text, View, NativeEventEmitter, Platform, TouchableOpacity, Image, Button } from 'react-native'
|
|
3
3
|
import DocumentReader, { Enum, DocumentReaderCompletion, DocumentReaderScenario, RNRegulaDocumentReader, DocumentReaderResults, DocumentReaderNotification, ScannerConfig, RecognizeConfig, DocReaderConfig, Functionality } from '@regulaforensics/react-native-document-reader-api'
|
|
4
4
|
import * as RNFS from 'react-native-fs'
|
|
5
5
|
import RadioGroup, { RadioButtonProps } from 'react-native-radio-buttons-group'
|
|
@@ -230,7 +230,7 @@ export default class App extends React.Component<IProps, IState> {
|
|
|
230
230
|
|
|
231
231
|
render() {
|
|
232
232
|
return (
|
|
233
|
-
<
|
|
233
|
+
<View style={styles.container}>
|
|
234
234
|
{!this.state.isReadingRfidCustomUi && <View style={styles.container}>
|
|
235
235
|
<Text style={styles.title}>{this.state.fullName}</Text>
|
|
236
236
|
|
|
@@ -281,7 +281,7 @@ export default class App extends React.Component<IProps, IState> {
|
|
|
281
281
|
<Text style={{ fontSize: 20 }}>X</Text>
|
|
282
282
|
</TouchableOpacity>
|
|
283
283
|
</View>}
|
|
284
|
-
</
|
|
284
|
+
</View>
|
|
285
285
|
)
|
|
286
286
|
}
|
|
287
287
|
}
|
|
@@ -295,6 +295,7 @@ const styles = StyleSheet.create({
|
|
|
295
295
|
alignItems: 'center',
|
|
296
296
|
backgroundColor: '#F5FCFF',
|
|
297
297
|
marginBottom: 12,
|
|
298
|
+
paddingTop: 15
|
|
298
299
|
},
|
|
299
300
|
cancelButton: {
|
|
300
301
|
position: 'absolute',
|
|
@@ -49,7 +49,7 @@ react {
|
|
|
49
49
|
//
|
|
50
50
|
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
51
51
|
// hermesFlags = ["-O", "-output-source-map"]
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
/* Autolinking */
|
|
54
54
|
autolinkLibrariesWithApp()
|
|
55
55
|
}
|
|
@@ -63,14 +63,14 @@ def enableProguardInReleaseBuilds = false
|
|
|
63
63
|
* The preferred build flavor of JavaScriptCore (JSC)
|
|
64
64
|
*
|
|
65
65
|
* For example, to use the international variant, you can use:
|
|
66
|
-
* `def jscFlavor =
|
|
66
|
+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
|
|
67
67
|
*
|
|
68
68
|
* The international variant includes ICU i18n library and necessary data
|
|
69
69
|
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
70
70
|
* give correct results when using with locales other than en-US. Note that
|
|
71
71
|
* this variant is about 6MiB larger per architecture than default.
|
|
72
72
|
*/
|
|
73
|
-
def jscFlavor = '
|
|
73
|
+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
|
|
74
74
|
|
|
75
75
|
android {
|
|
76
76
|
ndkVersion rootProject.ext.ndkVersion
|
|
@@ -3,10 +3,10 @@ buildscript {
|
|
|
3
3
|
buildToolsVersion = "35.0.0"
|
|
4
4
|
minSdkVersion = 24
|
|
5
5
|
compileSdkVersion = 35
|
|
6
|
-
targetSdkVersion =
|
|
7
|
-
|
|
8
|
-
ndkVersion = "
|
|
9
|
-
kotlinVersion = "
|
|
6
|
+
targetSdkVersion = 35
|
|
7
|
+
|
|
8
|
+
ndkVersion = "27.1.12297006"
|
|
9
|
+
kotlinVersion = "2.0.21"
|
|
10
10
|
}
|
|
11
11
|
repositories {
|
|
12
12
|
google()
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
6
6
|
zipStorePath=wrapper/dists
|
package/example/android/gradlew
CHANGED
|
@@ -83,7 +83,7 @@ done
|
|
|
83
83
|
# This is normally unused
|
|
84
84
|
# shellcheck disable=SC2034
|
|
85
85
|
APP_BASE_NAME=${0##*/}
|
|
86
|
-
APP_HOME=$( cd "${APP_HOME:-./}" &&
|
|
86
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
87
87
|
|
|
88
88
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
89
89
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
34B2241A2B61327D009FDA33 /* regula.license in Resources */ = {isa = PBXBuildFile; fileRef = 34B224192B61327D009FDA33 /* regula.license */; };
|
|
17
17
|
7699B88040F8A987B510C191 /* libPods-DocumentReader-DocumentReaderTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-DocumentReader-DocumentReaderTests.a */; };
|
|
18
18
|
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
|
19
|
+
970CEEFE26CC4F5086D8C455 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0B138461659C02ED353D3184 /* PrivacyInfo.xcprivacy */; };
|
|
19
20
|
/* End PBXBuildFile section */
|
|
20
21
|
|
|
21
22
|
/* Begin PBXContainerItemProxy section */
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
00E356EE1AD99517003FC87E /* DocumentReaderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DocumentReaderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
33
34
|
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
34
35
|
00E356F21AD99517003FC87E /* DocumentReaderTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DocumentReaderTests.m; sourceTree = "<group>"; };
|
|
36
|
+
0B138461659C02ED353D3184 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = DocumentReader/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
|
|
35
37
|
13B07F961A680F5B00A75B9A /* DocumentReader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DocumentReader.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
36
38
|
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = DocumentReader/AppDelegate.h; sourceTree = "<group>"; };
|
|
37
39
|
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = DocumentReader/AppDelegate.mm; sourceTree = "<group>"; };
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
13B07FB61A68108700A75B9A /* Info.plist */,
|
|
101
103
|
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
|
|
102
104
|
13B07FB71A68108700A75B9A /* main.m */,
|
|
105
|
+
0B138461659C02ED353D3184 /* PrivacyInfo.xcprivacy */,
|
|
103
106
|
);
|
|
104
107
|
name = DocumentReader;
|
|
105
108
|
sourceTree = "<group>";
|
|
@@ -254,6 +257,7 @@
|
|
|
254
257
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
|
255
258
|
34B2241A2B61327D009FDA33 /* regula.license in Resources */,
|
|
256
259
|
34A6AF2E2B862E4E00266440 /* db.dat in Resources */,
|
|
260
|
+
970CEEFE26CC4F5086D8C455 /* PrivacyInfo.xcprivacy in Resources */,
|
|
257
261
|
);
|
|
258
262
|
runOnlyForDeploymentPostprocessing = 0;
|
|
259
263
|
};
|
|
@@ -558,7 +562,7 @@
|
|
|
558
562
|
buildSettings = {
|
|
559
563
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
560
564
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
|
561
|
-
CLANG_CXX_LANGUAGE_STANDARD = "c++
|
|
565
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
|
562
566
|
CLANG_CXX_LIBRARY = "libc++";
|
|
563
567
|
CLANG_ENABLE_MODULES = YES;
|
|
564
568
|
CLANG_ENABLE_OBJC_ARC = YES;
|
|
@@ -621,8 +625,14 @@
|
|
|
621
625
|
"-DFOLLY_MOBILE=1",
|
|
622
626
|
"-DFOLLY_USE_LIBCPP=1",
|
|
623
627
|
);
|
|
628
|
+
OTHER_LDFLAGS = (
|
|
629
|
+
"$(inherited)",
|
|
630
|
+
" ",
|
|
631
|
+
);
|
|
624
632
|
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
625
633
|
SDKROOT = iphoneos;
|
|
634
|
+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
|
|
635
|
+
USE_HERMES = true;
|
|
626
636
|
};
|
|
627
637
|
name = Debug;
|
|
628
638
|
};
|
|
@@ -631,7 +641,7 @@
|
|
|
631
641
|
buildSettings = {
|
|
632
642
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
633
643
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
|
634
|
-
CLANG_CXX_LANGUAGE_STANDARD = "c++
|
|
644
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
|
|
635
645
|
CLANG_CXX_LIBRARY = "libc++";
|
|
636
646
|
CLANG_ENABLE_MODULES = YES;
|
|
637
647
|
CLANG_ENABLE_OBJC_ARC = YES;
|
|
@@ -686,8 +696,13 @@
|
|
|
686
696
|
"-DFOLLY_MOBILE=1",
|
|
687
697
|
"-DFOLLY_USE_LIBCPP=1",
|
|
688
698
|
);
|
|
699
|
+
OTHER_LDFLAGS = (
|
|
700
|
+
"$(inherited)",
|
|
701
|
+
" ",
|
|
702
|
+
);
|
|
689
703
|
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
690
704
|
SDKROOT = iphoneos;
|
|
705
|
+
USE_HERMES = true;
|
|
691
706
|
VALIDATE_PRODUCT = YES;
|
|
692
707
|
};
|
|
693
708
|
name = Release;
|