#Barcode scanning problems

1 messages · Page 1 of 1 (latest)

simple shadow
#

Having problem scanning a barcode. When it scans the app shutsdown and restarts Camera is activated with this:

    {
        Scanner::scan()
            ->prompt('Scan a barcode')
            ->formats(['all'])
            ->id('toolbar-scanner');
    }```

And listened to with this:

``` #[OnNative(CodeScanned::class)]
    public function barcodeScannedWithCamera($data, $format, $id = null): void
    {
        Dialog::toast("Scanned: {$data}");
    }```


The same result happens even if I use a single format not just `all`.

I have tested this on Pixel 8 (Android 16) and a Zebra TC22 (Android 13) and the same result happens on both.

I've tried to extract some info from `logcat` which I think is relevant and attached to this.

Thanks.
sharp halo
#

did you change the permission on the nativephp file?

ornate kettle
#

and then also your permissions config

simple shadow
#

AndroidManifest.xml is attached - I have very slightly modified this as I'm handling an Android Intent for the TC22 scanner but otherwise should be fine:

Here is config:

        'biometric' => true,
        'camera' => true,
        'nfc' => false,
        'push_notifications' => false,
        'location' => false,
        'vibrate' => false,
        'storage_read' => false,
        'storage_write' => false,
        'microphone' => false,
        'microphone_background' => false,
        'scanner' => true,
        'network_state' => true,
    ],```
#

Just added the following to manifest:

                <action android:name="android.intent.action.SCANNEDX" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>```
ornate kettle
#

try taking it out and see if you get the same error

simple shadow
#

Yes, each time I do a composer update I have to put a couple of modifications back in. Waiting for the plugin functionality! Will try without it.

simple shadow
#

Just done a composer update && php artisan native:install --force to version 2.1.2 and not added any of the modifications. Crashing still happens as soon as a barcode is scanned.

sharp halo