web-nfc-barcode-phone-apps
Installation
SKILL.md
Phone web apps: NFC tags and barcode scanning
Browser APIs that turn a phone into a tag reader or barcode scanner. Both are Chrome-on-Android only and both hard-require a secure context.
When to Use
- Building a web app that reads NFC tag UIDs from a phone (
NDEFReader) - Scanning product barcodes with the phone camera (
BarcodeDetector) - Writing NDEF URLs to tags so a tap opens a page
- Debugging why either API is
undefinedon a phone but fine on desktop
The secure-context trap (decide this first)
NDEFReader and BarcodeDetector are undefined outside a secure context.
A LAN IP (http://192.168.1.x:8000) is NOT a secure context. Only https://
or http://localhost qualify, and localhost doesn't help when the client is a
phone.