codescanner
0.0.1indexedEnables QR code scanning with customizable UI elements and error handling. Integrates with existing apps through simple configuration, supporting camera usage and permissions management.
Enables QR code scanning with customizable UI elements and error handling. Integrates with existing apps through simple configuration, supporting camera usage and permissions management.
[!WARNING] This library is deprecated and is no longer maintained. Use KMP Vision Camera instead: its
barcode-composemodule has aCodeScannercomposable, and scans many more formats on Android (ML Kit) and iOS (Apple Vision), with the full camera API of VisionCamera.
A CodeScanner library for Kotlin Compose Multiplatform
This library is a port of the CodeScanner iOS library, which I'm also maintaining.
Add the following dependency to your build.gradle.kts file, in the commonMain source set:
implementation("digital.guimauve.ui:codescanner:0.0.1")
CodeScannerView(
codeTypes = listOf(CodeType.QR_CODE),
onResult = { code ->
when (code) {
is ScanResult.Success -> {
// Handle QR code
}
is ScanResult.Error -> {
// Handle error
}
}
},
modifier = Modifier, // Customize layout as needed
)
On iOS, you need to add the NSCameraUsageDescription key to your Info.plist file with a description of why you need
camera access.
On Android, you need to add the following permissions and features to your AndroidManifest.xml file:
<uses-feature android:name="android.hardware.camera" android:required="false"/>
Surfaced from shared tags and platforms — no rankings paid for.