File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
android/src/main/java/com/sourcetoad/idscanreactnative Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -151,18 +151,25 @@ class IdscanSdkModule(reactContext: ReactApplicationContext) :
151151
152152 private fun showDefaultScanView () {
153153 if (checkCameraPermissions()) {
154- MultiScanActivity .build(currentActivity!! )
155- .withComponent(
156- PDF417Component .build()
157- .withLicenseKey(scannerPDFKey!! )
158- .complete()
159- )
160- .withComponent(
154+ val multiScanActivity = MultiScanActivity .build(currentActivity!! )
155+
156+ if (! (scannerMRZKey!! ).isNullOrEmpty()){
157+ multiScanActivity.withComponent(
161158 MRZComponent .build()
162159 .withLicenseKey(scannerMRZKey!! )
163160 .complete()
164161 )
165- .start(SCAN_ACTIVITY_CODE )
162+ }
163+
164+ if (! (scannerPDFKey!! ).isNullOrEmpty()) {
165+ multiScanActivity.withComponent(
166+ PDF417Component .build()
167+ .withLicenseKey(scannerPDFKey!! )
168+ .complete()
169+ )
170+ }
171+
172+ multiScanActivity.start(SCAN_ACTIVITY_CODE )
166173 } else {
167174 requestCameraPermissions(REQUEST_CAMERA_PERMISSIONS_DEFAULT )
168175 }
You can’t perform that action at this time.
0 commit comments