diff --git a/README.md b/README.md index d0ac70a..4a83cb3 100644 --- a/README.md +++ b/README.md @@ -113,14 +113,26 @@ export default function App() { const handleBarcodeScanned = event => { const {data, bounds, type} = event?.nativeEvent; setScannedData({data, bounds, type}); - console.log('Barcode scanned:', data, bounds, type); + console.log('Barcode / QR Code scanned:', data, bounds, type); + }; + + const enableFlashlight = () => { + if (scannerRef?.current) { + Commands.enableFlashlight(scannerRef.current); + } + }; + + const disableFlashlight = () => { + if (scannerRef?.current) { + Commands.disableFlashlight(scannerRef.current); + } }; // Pause the camera after barcode / QR code is scanned - const pauseScanning = () => { + const stopScanning = () => { if (scannerRef?.current) { - Commands.pauseScanning(scannerRef?.current); - console.log('Camera preview paused'); + Commands.stopScanning(scannerRef?.current); + console.log('Scanning paused'); } }; @@ -128,10 +140,22 @@ export default function App() { const resumeScanning = () => { if (scannerRef?.current) { Commands.resumeScanning(scannerRef?.current); - console.log('Camera preview resumed'); + console.log('Scanning resumed'); } }; + const releaseCamera = () => { + if (scannerRef?.current) { + Commands.releaseCamera(scannerRef?.current); + } + } + + const startScanning = () => { + if (scannerRef?.current) { + Commands.startCamera(scannerRef?.current); + } + } + const checkCameraPermission = async () => { request( Platform.OS === 'ios' @@ -165,22 +189,57 @@ export default function App() { if (isCameraPermissionGranted) { return ( - + {isActive && ( )} -