Skip to content

Commit 9cd69a2

Browse files
refactor(android): add PermissionAwareActivity import and simplify cast
- Add explicit import for PermissionAwareActivity - Replace fully qualified class name with imported reference - Improve code readability and follow Kotlin conventions
1 parent 58d834f commit 9cd69a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

android/src/main/java/com/pushpendersingh/reactnativescanner/ReactNativeScannerModule.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.facebook.react.bridge.ReactApplicationContext
1010
import com.facebook.react.bridge.ReactMethod
1111
import com.facebook.react.modules.core.DeviceEventManagerModule
1212
import com.facebook.react.module.annotations.ReactModule
13+
import com.facebook.react.modules.core.PermissionAwareActivity
1314
import com.facebook.react.modules.core.PermissionListener
1415

1516
@ReactModule(name = ReactNativeScannerModule.NAME)
@@ -128,7 +129,7 @@ class ReactNativeScannerModule(reactContext: ReactApplicationContext) :
128129
permissionPromise = promise
129130

130131
// Request permission using PermissionAwareActivity
131-
val permissionAwareActivity = currentActivity as? com.facebook.react.modules.core.PermissionAwareActivity
132+
val permissionAwareActivity = currentActivity as? PermissionAwareActivity
132133
if (permissionAwareActivity != null) {
133134
permissionAwareActivity.requestPermissions(
134135
arrayOf(Manifest.permission.CAMERA),

0 commit comments

Comments
 (0)