capacitor-nfc-tools
v0.0.1
Published
A plugin to scan NFC tags
Readme
nfc-tools
A plugin to scan NFC tags
Install
npm install capacitor-nfc-tools
npx cap syncIOS Permissions
In Xcode:
- Open your plugin's
- Select the plugin target.
- Go to Signing & Capabilities.
- Click + Capability -> Add Near Field Communicationn Tag Reading.
API
startScan()
startScan() => Promise<void>stopScan()
stopScan() => Promise<void>addListener('onTagScanned', ...)
addListener(eventName: 'onTagScanned', listenerFunc: (info: NfcTagInfo) => void) => Promise<{ remove: () => void; }>| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| eventName | 'onTagScanned' |
| listenerFunc | (info: NfcTagInfo) => void |
Returns: Promise<{ remove: () => void; }>
Interfaces
NfcTagInfo
| Prop | Type |
| ----------------- | ------------------------------------------------------------- |
| id | string |
| ndefRecords | { type: string; id: string; payload: string; }[] |
