Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Emit ¶
Emit delivers an NFC event (e.g. a scanned tag) to the frontend via whatever sink RegisterNFC installed. Exported so native providers bound through gomobile — which can't reach this package's unexported state — can push events without going through the Provider interface itself.
func SetEventSink ¶
SetEventSink registers the function used to deliver NFC events to the frontend. Safe to call with nil to clear it.
func SetProvider ¶
func SetProvider(p Provider)
func Write ¶
func Write(message NFCMessage) error
Types ¶
type NFCMessage ¶
type NFCMessage struct {
Records []NFCRecord `json:"records"`
}
type Provider ¶
type Provider interface {
StartScan() error
StopScan() error
Write(message NFCMessage) error
}
Provider is a native NFC backend. On mobile the shell registers one via SetProvider (android.nfc / CoreNFC) and delivers scanned tags through the bridge event channel. Desktop machines have no NFC reader API; Chrome on Android exposes Web NFC as a fallback.