Launch the app by a NFC tag and read the data
npm install capacitor-nfc-launch

bash
npm i capacitor-nfc-launch
npx cap sync android
`
AndroidManifest.xml
`
// The plugin will only fire the event, if a NFC tag with this Content-Type has been sent
`
How to write the tag
Download and open the app NFC Tools. Choose 'write' and add a dataset of the type 'data' (last entry in list).
Content-Type: application/APPBUNDLEID
Data: 'My example data'
Usage
app.component.ts
`javascript
import { NFCLaunch } from 'capacitor-nfc-launch';
if (Capacitor.isNativePlatform()) {
NFCLaunch.addListener('message', (data: any) => {
console.log(data.message); // Outputs: My example data
});
}
`
API
$3
`typescript
addListener(eventName: 'message', listenerFunc: MessageListener) => Promise & PluginListenerHandle
`Add a listener to a NFC message event
| Param | Type |
| ------------------ | ----------------------------------------------------------- |
|
eventName | 'message' |
| listenerFunc | MessageListener |Returns: any
--------------------
$3
`typescript
removeAllListeners() => any
`Removes all listeners.
Returns: any
--------------------
$3
#### PluginListenerHandle
| Prop | Type |
| ------------ | ------------------------- |
|
remove` | () => any |
#### MessageListener
(response: any): void