Opens the camera and scans selected codes: (qr, aztec, dataMatrix, pdf417, code128 and ean13)
try {
const deeplink = await Eitri.exposedApis.camera.startScanner({formats: ["qr_code", "ean_13"]})
if (!deeplink) {
setAlertMessage('code not detected')
setShowErrorAlert(true)
return
}
handleCode(deeplink)
} catch (error) {
console.log("startScanner.error: ", error);
}
Object containing an optional "formats" attribute that allowlists which formats are supported.
Optional
formats?: [CodeFormats]Array of strings representing the formats to be scanned. If not provided, all formats are supported.
returns the content of the code as a string if one is scanned.
Functions that allow an Eitri-App to use the device's camera through the operating system's native APIs.