0.1.5 • Published 6 years ago
capacitor-nfc v0.1.5
Capacitor NFC Plugin
Native Capacitor plugin to read NFC tags.
To install the plugin in your project, run:
npm install --save capacitor-nfc@latest
Supported Platforms
- Android
- iOS (Sorry, I do not have nor plan to acquire an iPhone. iOS contributions are welcome.)
Android Notes
This API requires the following permission be added to your AndroidManifest.xml:
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
iOS Notes
Specify the reason for your app to use the device’s NFC reader in Info.plist:
Name: Privacy - NFC Scan Usage Description Key: NFCReaderUsageDescription
Example
import { Plugins } from '@capacitor/core';
const { NFC } = Plugins;
class NFCExample {
async checkNfcStatus() {
if (Capacitor.isPluginAvailable('NFC')) {
const status = NFC.getStatus();
console.log('NFC is enabled', status);
if (status !== 'enabled') {
NFC.showSettings();
}
}
}
}
API
getStatus
Checks whether NFC is enabled and turned on.
getTagInfo
(TODO) Returns information about the touched NFC tag.
showSettings
Opens a settings page to allow the user to enable NFC.
NFC.showSettings();
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago