I am trying to scan a QR code with my xamarin forms app
I use the ZXing Package
I was able to turn the flashlight on the whole time with this:
TimeSpan timespan = new TimeSpan(0, 0, 0, 0, 0);
Device.StartTimer(timespan, () =>
{
scanner.Torch(true);
return true;
});
var scanResult = await scanner.Scan(optionsCustom);
return scanResult.Text;
Is there a way to turn the flashlight on only when needed?
or intercept the Volume Buttons to turn the Flashlight on and off manually
You can create custom overlay for your scanner with button that turns on/off the flashlight.