Skip to content

Commit 507c2b6

Browse files
committed
feat(qr-code): integrate capacitor barcode scanner for QR code scanning
- Add BarcodeScanner plugin configuration to capacitor config for Android - Include barcode scanner module in Android project settings and dependencies - Add CAMERA permission to AndroidManifest.xml - Implement QR code scanning functionality in QrCodePage component - Show scan result and allow rescanning in UI - Update package.json and package-lock.json with @capacitor/barcode-scanner dependency - Inject and use trpc client in SettingsPage for async settings display - Add environment API URL constants for prod and dev - Provide trpc client in main bootstrap providers - Enable skipLibCheck in tsconfig for smoother build - Pass apiUrl environment variable in dashboard QR code generation on server side
1 parent bc29516 commit 507c2b6

File tree

18 files changed

+468
-69
lines changed

18 files changed

+468
-69
lines changed

mobile/android/app/capacitor.build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ android {
1010
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
1111
dependencies {
1212
implementation project(':capacitor-app')
13+
implementation project(':capacitor-barcode-scanner')
1314
implementation project(':capacitor-haptics')
1415
implementation project(':capacitor-keyboard')
1516
implementation project(':capacitor-status-bar')

mobile/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@
3838
<!-- Permissions -->
3939

4040
<uses-permission android:name="android.permission.INTERNET" />
41-
</manifest>
41+
<uses-permission android:name="android.permission.CAMERA" />
42+
</manifest>

mobile/android/capacitor.settings.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
55
include ':capacitor-app'
66
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
77

8+
include ':capacitor-barcode-scanner'
9+
project(':capacitor-barcode-scanner').projectDir = new File('../node_modules/@capacitor/barcode-scanner/android')
10+
811
include ':capacitor-haptics'
912
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
1013

mobile/capacitor.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ const config: CapacitorConfig = {
1212
"keystoreAlias": "my-dashboard",
1313
"keystoreAliasPassword": "12345678"
1414
}
15+
},
16+
plugins: {
17+
BarcodeScanner: {
18+
android: {
19+
scanningLibrary: "zxing"
20+
}
21+
}
1522
}
1623
};
1724

0 commit comments

Comments
 (0)