Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
capacitor-nfc-launch
Advanced tools
Readme
This plugin reads the message of a self-written NFC tag. Just tap the device on a NFC tag and you will get the response in the 'message' listener. Your app will also start automatically and trigger the event listener.
Platform | Supported |
---|---|
Android | ✔ |
iOS | ✖ |
Web | ✖ |
npm i capacitor-nfc-launch
npx cap sync android
AndroidManifest.xml
<intent-filter android:autoVerify="true">
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
// The plugin will only fire the event, if a NFC tag with this Content-Type has been sent
<data android:mimeType="application/APPBUNDLEID" />
</intent-filter>
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'
app.component.ts
import { NFCLaunch } from 'capacitor-nfc-launch';
if (Capacitor.isNativePlatform()) {
NFCLaunch.addListener('message', (data: any) => {
console.log(data.message); // Outputs: My example data
});
}
addListener(eventName: 'message', listenerFunc: MessageListener) => Promise<PluginListenerHandle> & PluginListenerHandle
Add a listener to a NFC message event
Param | Type |
---|---|
eventName | 'message' |
listenerFunc | MessageListener |
Returns: any
removeAllListeners() => any
Removes all listeners.
Returns: any
Prop | Type |
---|---|
remove | () => any |
(response: any): void
FAQs
Launch the app by a NFC tag and read the data
The npm package capacitor-nfc-launch receives a total of 10 weekly downloads. As such, capacitor-nfc-launch popularity was classified as not popular.
We found that capacitor-nfc-launch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.