Skip to main content
Native Plugins & Integrations1 min read

QR and Barcode Scanner

Scan QR codes and barcodes from your website with a native full-screen scanner: supported formats, scanner screen options, permissions and code examples.

Overview

The QR / Barcode Scanner plugin opens a native full-screen scanner and returns the result to your page. It is faster and more reliable than scanning in the browser.

Turn it on in Integrations › Native plugins and build a new version.

Scan

javascript
const result = await wapp.barcode.scan({
  formats: ['QR_CODE', 'EAN_13'],
  prompt: 'Scan your ticket',
});

if (result.success) {
  console.log(result.type, result.code); // "QR_CODE", "https://..."
} else if (result.code === 'CANCELLED') {
  // the user closed the scanner
} else if (result.code === 'PERMISSION_DENIED') {
  // camera access was refused
}

Formats: QR_CODE, DATA_MATRIX, AZTEC, PDF_417, EAN_13, EAN_8, UPC_A, UPC_E, CODE_39, CODE_93, CODE_128, ITF (ITF-14 only) and CODABAR. Leave formats out to scan all of them.

wapp.barcode.setPrompt('Point at the code') changes the text for the next scans. The Default prompt setting does the same without code.

Plugin settings

SettingWhat it doesNew build?
Scanner screenthemed: full screen in your colors. system: the phone's own scannerYes
Camera permission text (iOS)The camera purpose stringYes
Default promptText shown in the scannerNo
themed (default)system
Androidasks for camera permissionno camera permission needed
iPhoneasks for camera permissionasks for camera permission (iOS 16 and later)

Tips

  • Limit formats to what you expect: scanning is faster and avoids wrong matches.
  • Validate the scanned value on your server before acting on it.

Next steps