---
description: Capacitor plugin for NFC tag reading, writing, and emulation. Supports Android, iOS, and Web with advanced features like HCE and raw command handling.
title: Capacitor NFC Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/nfc.png
---

<!doctype html> 

[Skip to content ](#capacitor-nfc-plugin) 

[🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode. ](/blog/announcing-the-capacitor-vault-plugin/) 

* [ SDKs ](/docs/sdks/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* NFC [ NFC ](/docs/sdks/capacitor/nfc/)
* [ iOS ](#ios)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Type Aliases ](#type-aliases)
* [ Enums ](#enums)
* [ Utils ](#utils)
* [ Troubleshooting ](#troubleshooting)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ Breaking Changes ](#breaking-changes)
* [ License ](#license)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ iOS ](#ios)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Type Aliases ](#type-aliases)
* [ Enums ](#enums)
* [ Utils ](#utils)
* [ Troubleshooting ](#troubleshooting)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ Breaking Changes ](#breaking-changes)
* [ License ](#license)

# Capacitor NFC Plugin[¶](#capacitor-nfc-plugin "Permanent link")

Capacitor plugin for NFC tag reading, writing, and emulation. Supports Android, iOS, and Web with advanced features like HCE and raw command handling.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

The Capacitor NFC plugin is one of the most complete NFC solutions for Capacitor apps. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS and Web.
* 🔄 **NDEF**: Read and write NFC Data Exchange Format (NDEF) messages.
* 📳 **HCE**: Emulate an NFC card that other devices can interact with.
* ⌘ **Raw Commands**: Send raw commands to an NFC tag and receive the response.
* 🛠️ **Utils**: Utility functions to make your life easier.
* ⚔️ **Battle-Tested**: Used in more than 500 projects.
* 📚 **Documentation**: Comprehensive documentation to help you get started.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Use Cases[¶](#use-cases "Permanent link")

The NFC plugin is typically used whenever an app needs to interact with NFC tags or readers, for example:

* **Inventory and asset tracking**: Scan NFC tags to read their identifiers and NDEF messages, for example to identify equipment or products.
* **Tag provisioning**: Write NDEF messages such as text or URI records to tags and optionally make them permanently read-only.
* **App launching**: Launch your app by scanning a tag containing a URI record, using an intent filter on Android or universal links on iOS.
* **Smartcard communication**: Exchange raw commands such as APDUs with tags and smartcards using the `transceive(...)` method.
* **Card emulation**: Emulate an NFC card on Android using Host Card Emulation (HCE) so that other devices can interact with it.

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |
| 6.x.x          | 6.x.x             | Deprecated     |

## Demo[¶](#demo "Permanent link")

A working example can be found [here](https://github.com/capawesome-team/capacitor-nfc-demo).

| Android                                                                                                                                 | iOS                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| ![Android Demo](../../../assets/external/user-images.githubusercontent.com/13857929/184409092-7fdc3a77-67b1-4155-b1b1-0fd34a92a77b.gif) | ![iOS Demo](../../../assets/external/user-images.githubusercontent.com/13857929/184409000-a81243a3-93e5-4d51-817a-e006c0a385cf.gif) |

## Guides[¶](#guides "Permanent link")

* [Announcing the Capacitor NFC Plugin](https://capawesome.io/blog/announcing-the-capacitor-nfc-plugin/)
* [Exploring the Capacitor NFC API](https://capawesome.io/blog/exploring-the-capacitor-nfc-api/)

## Installation[¶](#installation "Permanent link")

This plugin is only available to [Capawesome Insiders](https://capawesome.io/insiders/). First, make sure you have the Capawesome npm registry set up. You can do this by running the following commands:

`[](#%5F%5Fcodelineno-0-1)npm config set @capawesome-team:registry https://npm.registry.capawesome.io
[](#%5F%5Fcodelineno-0-2)npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
`

**Attention**: Replace `<YOUR_LICENSE_KEY>` with the license key you received from Polar. If you don't have a license key yet, you can get one by becoming a [Capawesome Insider](https://capawesome.io/insiders/).

Next, you can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-1-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-2-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome-team/capacitor-nfc` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-3-1)npm install @capawesome-team/capacitor-nfc
[](#%5F%5Fcodelineno-3-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Features[¶](#features%5F1 "Permanent link")

Add the following element to your `AndroidManifest.xml` before or after the `application` tag:

`[](#%5F%5Fcodelineno-4-1)<uses-feature android:name="android.hardware.nfc" android:required="true" />
`

Set the `android:required` attribute to `true` if your app can't function, or isn't designed to function, when NFC is not available on the device. If your app can function without NFC, set the `android:required` attribute to `false`. This will allow your app to be installed on devices that do not support NFC.

#### Intent Filter[¶](#intent-filter "Permanent link")

If you want to launch your app through an NFC tag, please take a look at the [Android documentation](https://developer.android.com/guide/topics/connectivity/nfc/nfc#dispatching). There you will find which changes you have to apply to your `AndroidManifest.xml` ([example](https://developer.android.com/guide/topics/connectivity/nfc/nfc#ndef-disc)).

#### Services[¶](#services "Permanent link")

To be able to use Host Card Emulation (HCE), you also need to add the following service **inside** the `application` tag in your `AndroidManifest.xml` (usually `android/app/src/main/AndroidManifest.xml`):

`[](#%5F%5Fcodelineno-5-1)<service android:name=".MyHostApduService" android:exported="true"
[](#%5F%5Fcodelineno-5-2)         android:permission="android.permission.BIND_NFC_SERVICE">
[](#%5F%5Fcodelineno-5-3)    <intent-filter>
[](#%5F%5Fcodelineno-5-4)        <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
[](#%5F%5Fcodelineno-5-5)    </intent-filter>
[](#%5F%5Fcodelineno-5-6)    <meta-data android:name="android.nfc.cardemulation.host_apdu_service"
[](#%5F%5Fcodelineno-5-7)               android:resource="@xml/apduservice"/>
[](#%5F%5Fcodelineno-5-8)</service>
`

This meta-data tag points to an `apduservice.xml` file. The following is an example of such a file with a single AID group declaration containing two proprietary AIDs:

`[](#%5F%5Fcodelineno-6-1)<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
[](#%5F%5Fcodelineno-6-2)           android:description="@string/servicedesc"
[](#%5F%5Fcodelineno-6-3)           android:requireDeviceUnlock="false">
[](#%5F%5Fcodelineno-6-4)    <aid-group android:description="@string/aiddescription"
[](#%5F%5Fcodelineno-6-5)               android:category="other">
[](#%5F%5Fcodelineno-6-6)        <aid-filter android:name="F0010203040506"/>
[](#%5F%5Fcodelineno-6-7)        <aid-filter android:name="F0394148148100"/>
[](#%5F%5Fcodelineno-6-8)    </aid-group>
[](#%5F%5Fcodelineno-6-9)</host-apdu-service>
`

You can find more information about this in the [Android documentation](https://developer.android.com/develop/connectivity/nfc/hce#manifest-declaration).

#### Proguard[¶](#proguard "Permanent link")

If you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:

`[](#%5F%5Fcodelineno-7-1)-keep class io.capawesome.capacitorjs.plugins.** { *; }
`

### iOS[¶](#ios "Permanent link")

#### Entitlements[¶](#entitlements "Permanent link")

Ensure `Near Field Communication Tag Reading` and `NFC Scan` capabilities have been enabled in your application in Xcode. See [Add a capability to a target](https://help.apple.com/xcode/mac/current/#/dev88ff319e7) for more information.

This will also create or update the `ios/App/App/App.entitlements` file. Make sure it contains the following key to allow reading NFC tags:

`[](#%5F%5Fcodelineno-8-1)<?xml version="1.0" encoding="UTF-8"?>
[](#%5F%5Fcodelineno-8-2)<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
[](#%5F%5Fcodelineno-8-3)<plist version="1.0">
[](#%5F%5Fcodelineno-8-4)<dict>
[](#%5F%5Fcodelineno-8-5)    <key>com.apple.developer.nfc.readersession.formats</key>
[](#%5F%5Fcodelineno-8-6)    <array>
[](#%5F%5Fcodelineno-8-7)        <string>NDEF</string>
[](#%5F%5Fcodelineno-8-8)        <string>TAG</string>
[](#%5F%5Fcodelineno-8-9)    </array>
[](#%5F%5Fcodelineno-8-10)</dict>
[](#%5F%5Fcodelineno-8-11)</plist>
`

#### Privacy Descriptions[¶](#privacy-descriptions "Permanent link")

Add the `NFCReaderUsageDescription` key to the `ios/App/App/Info.plist` file, which tells the user why the app needs to use NFC:

`[](#%5F%5Fcodelineno-9-1)<key>NFCReaderUsageDescription</key>
[](#%5F%5Fcodelineno-9-2)<string>The app enables the reading and writing of various NFC tags.</string>
`

#### Universal Links[¶](#universal-links "Permanent link")

If you want to launch your app through an NFC tag, please take a look at the [Core NFC documentation](https://developer.apple.com/documentation/corenfc/adding%5Fsupport%5Ffor%5Fbackground%5Ftag%5Freading#3032598). The NFC tag requires a [URI record](https://w3c.github.io/web-nfc/#uri-record) (see [createNdefUriRecord(...)](https://github.com/capawesome-team/capacitor-plugins/tree/main/packages/nfc/docs/utils#createndefurirecord)) that must contain either a universal link (see [Deep Linking with Universal and App Links](https://capacitorjs.com/docs/guides/deep-links)) or a [supported URL scheme](https://developer.apple.com/documentation/corenfc/adding%5Fsupport%5Ffor%5Fbackground%5Ftag%5Freading#3032600).

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

The following examples show how to read, write, make read-only, erase, and format NFC tags, send raw commands, check NFC support and permissions, and use Host Card Emulation.

### Read an NFC tag[¶](#read-an-nfc-tag "Permanent link")

Start a scan session and listen for the `nfcTagScanned` event to receive the scanned tag. Only one session can be active at a time, so stop the session as soon as you are done. On iOS, starting a scan session triggers the NFC Reader Session alert:

`[](#%5F%5Fcodelineno-10-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-10-2)
[](#%5F%5Fcodelineno-10-3)const read = async () => {
[](#%5F%5Fcodelineno-10-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-10-5)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-10-6)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-10-7)      resolve(event.nfcTag);
[](#%5F%5Fcodelineno-10-8)    });
[](#%5F%5Fcodelineno-10-9)
[](#%5F%5Fcodelineno-10-10)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-10-11)  });
[](#%5F%5Fcodelineno-10-12)};
`

### Write to an NFC tag[¶](#write-to-an-nfc-tag "Permanent link")

Create an NDEF record, for example with the `NfcUtils` class (see [Utils](#utils)), and write it to the tag from within the `nfcTagScanned` handler:

`[](#%5F%5Fcodelineno-11-1)import { Nfc, NfcUtils } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-11-2)
[](#%5F%5Fcodelineno-11-3)const createNdefTextRecord = () => {
[](#%5F%5Fcodelineno-11-4)  const utils = new NfcUtils();
[](#%5F%5Fcodelineno-11-5)  const { record } = utils.createNdefTextRecord({ text: 'Capacitor NFC Plugin' });
[](#%5F%5Fcodelineno-11-6)  return record;
[](#%5F%5Fcodelineno-11-7)};
[](#%5F%5Fcodelineno-11-8)
[](#%5F%5Fcodelineno-11-9)const write = async () => {
[](#%5F%5Fcodelineno-11-10)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-11-11)    const record = createNdefTextRecord();
[](#%5F%5Fcodelineno-11-12)
[](#%5F%5Fcodelineno-11-13)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-11-14)      await Nfc.write({ message: { records: [record] } });
[](#%5F%5Fcodelineno-11-15)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-11-16)      resolve();
[](#%5F%5Fcodelineno-11-17)    });
[](#%5F%5Fcodelineno-11-18)
[](#%5F%5Fcodelineno-11-19)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-11-20)  });
[](#%5F%5Fcodelineno-11-21)};
`

### Make an NFC tag read-only[¶](#make-an-nfc-tag-read-only "Permanent link")

Use the `makeReadOnly()` method to write-protect a tag. **Attention**: This is permanent and cannot be undone:

`[](#%5F%5Fcodelineno-12-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-12-2)
[](#%5F%5Fcodelineno-12-3)const makeReadOnly = async () => {
[](#%5F%5Fcodelineno-12-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-12-5)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-12-6)      await Nfc.makeReadOnly();
[](#%5F%5Fcodelineno-12-7)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-12-8)      resolve();
[](#%5F%5Fcodelineno-12-9)    });
[](#%5F%5Fcodelineno-12-10)
[](#%5F%5Fcodelineno-12-11)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-12-12)  });
[](#%5F%5Fcodelineno-12-13)};
`

### Erase or format an NFC tag[¶](#erase-or-format-an-nfc-tag "Permanent link")

Use the `erase()` method to write an empty NDEF message to the tag, or the `format()` method to format the tag as NDEF first. The `format()` method is only available on Android:

`[](#%5F%5Fcodelineno-13-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-13-2)
[](#%5F%5Fcodelineno-13-3)const erase = async () => {
[](#%5F%5Fcodelineno-13-4)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-13-5)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-13-6)      await Nfc.erase();
[](#%5F%5Fcodelineno-13-7)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-13-8)      resolve();
[](#%5F%5Fcodelineno-13-9)    });
[](#%5F%5Fcodelineno-13-10)
[](#%5F%5Fcodelineno-13-11)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-13-12)  });
[](#%5F%5Fcodelineno-13-13)};
[](#%5F%5Fcodelineno-13-14)
[](#%5F%5Fcodelineno-13-15)const format = async () => {
[](#%5F%5Fcodelineno-13-16)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-13-17)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-13-18)      await Nfc.format();
[](#%5F%5Fcodelineno-13-19)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-13-20)      resolve();
[](#%5F%5Fcodelineno-13-21)    });
[](#%5F%5Fcodelineno-13-22)
[](#%5F%5Fcodelineno-13-23)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-13-24)  });
[](#%5F%5Fcodelineno-13-25)};
`

### Send raw commands to an NFC tag[¶](#send-raw-commands-to-an-nfc-tag "Permanent link")

Use the `transceive(...)` method to send raw commands to the tag and receive the response. On Android, you must connect to the tag with `connect(...)` first and close the connection with `close()` afterwards. On iOS, pass the tag technology directly to `transceive(...)`. This method is only available on Android and iOS. The following example reads the signature of a tag:

`[](#%5F%5Fcodelineno-14-1)import { Nfc, NfcTagTechType } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-14-2)import { Capacitor } from '@capacitor/core';
[](#%5F%5Fcodelineno-14-3)
[](#%5F%5Fcodelineno-14-4)const readSignature = async () => {
[](#%5F%5Fcodelineno-14-5)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-14-6)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-14-7)      if (Capacitor.getPlatform() === 'android') {
[](#%5F%5Fcodelineno-14-8)        // 1. Connect to the tag.
[](#%5F%5Fcodelineno-14-9)        await Nfc.connect({ techType: NfcTagTechType.NfcA }); 
[](#%5F%5Fcodelineno-14-10)        // 2. Send one or more commands to the tag and receive the response.
[](#%5F%5Fcodelineno-14-11)        const result = await Nfc.transceive({ data: [60, 0] });
[](#%5F%5Fcodelineno-14-12)        // 3. Close the connection to the tag.
[](#%5F%5Fcodelineno-14-13)        await Nfc.close();
[](#%5F%5Fcodelineno-14-14)        await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-14-15)        resolve(result);
[](#%5F%5Fcodelineno-14-16)      } else {
[](#%5F%5Fcodelineno-14-17)        // 1. Send one or more commands to the tag and receive the response.
[](#%5F%5Fcodelineno-14-18)        const result = await Nfc.transceive({ techType: NfcTagTechType.NfcA, data: [60, 0] });
[](#%5F%5Fcodelineno-14-19)        await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-14-20)        resolve(result);
[](#%5F%5Fcodelineno-14-21)      }
[](#%5F%5Fcodelineno-14-22)    });
[](#%5F%5Fcodelineno-14-23)
[](#%5F%5Fcodelineno-14-24)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-14-25)  });
[](#%5F%5Fcodelineno-14-26)};
`

### Check whether NFC is supported and enabled[¶](#check-whether-nfc-is-supported-and-enabled "Permanent link")

Use the `isSupported()` method to check whether the device supports NFC and the `isEnabled()` method to check whether NFC is enabled:

`[](#%5F%5Fcodelineno-15-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-15-2)
[](#%5F%5Fcodelineno-15-3)const isSupported = async () => {
[](#%5F%5Fcodelineno-15-4)  const { nfc } = await Nfc.isSupported();
[](#%5F%5Fcodelineno-15-5)  return nfc;
[](#%5F%5Fcodelineno-15-6)};
[](#%5F%5Fcodelineno-15-7)
[](#%5F%5Fcodelineno-15-8)const isEnabled = async () => {
[](#%5F%5Fcodelineno-15-9)  const { isEnabled } = await Nfc.isEnabled();
[](#%5F%5Fcodelineno-15-10)  return isEnabled;
[](#%5F%5Fcodelineno-15-11)};
`

### Open the NFC device settings[¶](#open-the-nfc-device-settings "Permanent link")

Open the NFC device settings so that the user can enable or disable NFC. Only available on Android:

`[](#%5F%5Fcodelineno-16-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-16-2)
[](#%5F%5Fcodelineno-16-3)const openSettings = async () => {
[](#%5F%5Fcodelineno-16-4)  await Nfc.openSettings();
[](#%5F%5Fcodelineno-16-5)};
`

### Check and request permissions[¶](#check-and-request-permissions "Permanent link")

Checking and requesting permissions is only needed on Web. On Android and iOS, `granted` is always returned:

`[](#%5F%5Fcodelineno-17-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-17-2)
[](#%5F%5Fcodelineno-17-3)const checkPermissions = async () => {
[](#%5F%5Fcodelineno-17-4)  const { nfc } = await Nfc.checkPermissions();
[](#%5F%5Fcodelineno-17-5)  return nfc;
[](#%5F%5Fcodelineno-17-6)};
[](#%5F%5Fcodelineno-17-7)
[](#%5F%5Fcodelineno-17-8)const requestPermissions = async () => {
[](#%5F%5Fcodelineno-17-9)  const { nfc } = await Nfc.requestPermissions();
[](#%5F%5Fcodelineno-17-10)  return nfc;
[](#%5F%5Fcodelineno-17-11)};
`

### Remove all listeners[¶](#remove-all-listeners "Permanent link")

Remove all listeners for this plugin when they are no longer needed:

`[](#%5F%5Fcodelineno-18-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-18-2)
[](#%5F%5Fcodelineno-18-3)const removeAllListeners = async () => {
[](#%5F%5Fcodelineno-18-4)  await Nfc.removeAllListeners();
[](#%5F%5Fcodelineno-18-5)};
`

### Advanced[¶](#advanced "Permanent link")

#### HCE[¶](#hce "Permanent link")

Host Card Emulation (HCE) allows your device to emulate an NFC card that other devices can interact with. The first example below demonstrates how to send APDU commands from an NFC reader using the `transceive(...)` method:

`[](#%5F%5Fcodelineno-19-1)import { Nfc, NfcTagTechType } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-19-2)import { Capacitor } from '@capacitor/core';
[](#%5F%5Fcodelineno-19-3)
[](#%5F%5Fcodelineno-19-4)const sendApduCommands = async () => {
[](#%5F%5Fcodelineno-19-5)  return new Promise((resolve) => {
[](#%5F%5Fcodelineno-19-6)    Nfc.addListener('nfcTagScanned', async (event) => {
[](#%5F%5Fcodelineno-19-7)      // Define APDU commands
[](#%5F%5Fcodelineno-19-8)      const selectApdu = [0x00, 0xA4, 0x04, 0x00, 0x07, 0xF0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00];
[](#%5F%5Fcodelineno-19-9)      const customApdu = [0x00, 0x01, 0x00, 0x00, 0x00];
[](#%5F%5Fcodelineno-19-10)
[](#%5F%5Fcodelineno-19-11)      // Connect to the tag (Android only)
[](#%5F%5Fcodelineno-19-12)      if (Capacitor.getPlatform() === 'android') {
[](#%5F%5Fcodelineno-19-13)        await Nfc.connect({ techType: NfcTagTechType.IsoDep });
[](#%5F%5Fcodelineno-19-14)      }
[](#%5F%5Fcodelineno-19-15)
[](#%5F%5Fcodelineno-19-16)      // Send SELECT APDU command
[](#%5F%5Fcodelineno-19-17)      const selectResponse = await Nfc.transceive({
[](#%5F%5Fcodelineno-19-18)        techType: NfcTagTechType.Iso7816,
[](#%5F%5Fcodelineno-19-19)        data: selectApdu
[](#%5F%5Fcodelineno-19-20)      });
[](#%5F%5Fcodelineno-19-21)
[](#%5F%5Fcodelineno-19-22)      // Send custom APDU command
[](#%5F%5Fcodelineno-19-23)      const customResponse = await Nfc.transceive({
[](#%5F%5Fcodelineno-19-24)        techType: NfcTagTechType.Iso7816,
[](#%5F%5Fcodelineno-19-25)        data: customApdu
[](#%5F%5Fcodelineno-19-26)      });
[](#%5F%5Fcodelineno-19-27)
[](#%5F%5Fcodelineno-19-28)      // Close the connection (Android only)
[](#%5F%5Fcodelineno-19-29)      if (Capacitor.getPlatform() === 'android') {
[](#%5F%5Fcodelineno-19-30)        await Nfc.close();
[](#%5F%5Fcodelineno-19-31)      }
[](#%5F%5Fcodelineno-19-32)
[](#%5F%5Fcodelineno-19-33)      // Stop the scan session
[](#%5F%5Fcodelineno-19-34)      await Nfc.stopScanSession();
[](#%5F%5Fcodelineno-19-35)      resolve();
[](#%5F%5Fcodelineno-19-36)    });
[](#%5F%5Fcodelineno-19-37)    // Start the scan session
[](#%5F%5Fcodelineno-19-38)    Nfc.startScanSession();
[](#%5F%5Fcodelineno-19-39)  });
[](#%5F%5Fcodelineno-19-40)};
`

The second example below demonstrates how to respond to APDU commands sent by an NFC reader using the `commandReceived` event listener and the `respond(...)` method:

`[](#%5F%5Fcodelineno-20-1)import { Nfc } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-20-2)
[](#%5F%5Fcodelineno-20-3)const respondToApduCommands = async () => {
[](#%5F%5Fcodelineno-20-4)  // Listen for incoming APDU commands
[](#%5F%5Fcodelineno-20-5)  Nfc.addListener('commandReceived', async (event) => {
[](#%5F%5Fcodelineno-20-6)    // Parse the incoming command
[](#%5F%5Fcodelineno-20-7)    const command = event.data;
[](#%5F%5Fcodelineno-20-8)
[](#%5F%5Fcodelineno-20-9)    // Check if it's a SELECT command
[](#%5F%5Fcodelineno-20-10)    if (command[0] === 0x00 && command[1] === 0xA4 && command[2] === 0x04 && command[3] === 0x00) {
[](#%5F%5Fcodelineno-20-11)      // Respond with success status (0x9000)
[](#%5F%5Fcodelineno-20-12)      const response = [0x90, 0x00];
[](#%5F%5Fcodelineno-20-13)      await Nfc.respond({ data: response });
[](#%5F%5Fcodelineno-20-14)    }
[](#%5F%5Fcodelineno-20-15)    // Check for custom command
[](#%5F%5Fcodelineno-20-16)    else if (command[0] === 0x00 && command[1] === 0x01) {
[](#%5F%5Fcodelineno-20-17)      // Respond with custom data
[](#%5F%5Fcodelineno-20-18)      const response = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x90, 0x00]; // "Hello" + success status
[](#%5F%5Fcodelineno-20-19)      await Nfc.respond({ data: response });
[](#%5F%5Fcodelineno-20-20)    }
[](#%5F%5Fcodelineno-20-21)    // Unknown command
[](#%5F%5Fcodelineno-20-22)    else {
[](#%5F%5Fcodelineno-20-23)      // Respond with error status (0x6D00 - Instruction not supported)
[](#%5F%5Fcodelineno-20-24)      const response = [0x6D, 0x00];
[](#%5F%5Fcodelineno-20-25)      await Nfc.respond({ data: response });
[](#%5F%5Fcodelineno-20-26)    }
[](#%5F%5Fcodelineno-20-27)  });
[](#%5F%5Fcodelineno-20-28)};
`

## API[¶](#api "Permanent link")

* [startScanSession(...)](#startscansession)
* [stopScanSession(...)](#stopscansession)
* [write(...)](#write)
* [respond(...)](#respond)
* [makeReadOnly()](#makereadonly)
* [erase()](#erase)
* [format()](#format)
* [transceive(...)](#transceive)
* [connect(...)](#connect)
* [close()](#close)
* [isAvailable()](#isavailable)
* [isSupported()](#issupported)
* [isEnabled()](#isenabled)
* [openSettings()](#opensettings)
* [getAntennaInfo()](#getantennainfo)
* [setAlertMessage(...)](#setalertmessage)
* [checkPermissions()](#checkpermissions)
* [requestPermissions()](#requestpermissions)
* [addListener('commandReceived', ...)](#addlistenercommandreceived-)
* [addListener('nfcLinkDeactivated', ...)](#addlistenernfclinkdeactivated-)
* [addListener('nfcTagScanned', ...)](#addlistenernfctagscanned-)
* [addListener('scanSessionCanceled', ...)](#addlistenerscansessioncanceled-)
* [addListener('scanSessionError', ...)](#addlistenerscansessionerror-)
* [removeAllListeners()](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)
* [Enums](#enums)

### startScanSession(...)[¶](#startscansession "Permanent link")

`[](#%5F%5Fcodelineno-21-1)startScanSession(options?: StartScanSessionOptions | undefined) => Promise<void>
`

Start a scan session. Only one session can be active at a time.

Stop the session as soon as you are done using `stopScanSession(...)`.

On iOS, this will trigger the NFC Reader Session alert.

| Param       | Type                                                |
| ----------- | --------------------------------------------------- |
| **options** | [StartScanSessionOptions](#startscansessionoptions) |

**Since:** 0.0.1

---

### stopScanSession(...)[¶](#stopscansession "Permanent link")

`[](#%5F%5Fcodelineno-22-1)stopScanSession(options?: StopScanSessionOptions | undefined) => Promise<void>
`

Stop the active scan session.

| Param       | Type                                              |
| ----------- | ------------------------------------------------- |
| **options** | [StopScanSessionOptions](#stopscansessionoptions) |

**Since:** 0.0.1

---

### write(...)[¶](#write "Permanent link")

`[](#%5F%5Fcodelineno-23-1)write(options: WriteOptions) => Promise<void>
`

Write to a NFC tag.

This method must be called from within a `nfcTagScanned` handler.

| Param       | Type                          |
| ----------- | ----------------------------- |
| **options** | [WriteOptions](#writeoptions) |

**Since:** 0.0.1

---

### respond(...)[¶](#respond "Permanent link")

`[](#%5F%5Fcodelineno-24-1)respond(options: RespondOptions) => Promise<void>
`

Send a response APDU back to the remote device.

Only available on Android.

| Param       | Type                              |
| ----------- | --------------------------------- |
| **options** | [RespondOptions](#respondoptions) |

**Since:** 6.3.0

---

### makeReadOnly()[¶](#makereadonly "Permanent link")

`[](#%5F%5Fcodelineno-25-1)makeReadOnly() => Promise<void>
`

Make a NFC tag readonly.

This method must be called from within a `nfcTagScanned` handler.

**Attention:** This is permanent and can not be undone.

**Since:** 0.0.1

---

### erase()[¶](#erase "Permanent link")

`[](#%5F%5Fcodelineno-26-1)erase() => Promise<void>
`

Erase the NFC tag by writing an empty NDEF message.

This method must be called from within a `nfcTagScanned` handler.

**Since:** 0.3.0

---

### format()[¶](#format "Permanent link")

`[](#%5F%5Fcodelineno-27-1)format() => Promise<void>
`

Format the NFC tag as NDEF and write an empty NDEF message.

This method must be called from within a `nfcTagScanned` handler.

Only available on Android.

**Since:** 0.3.0

---

### transceive(...)[¶](#transceive "Permanent link")

`[](#%5F%5Fcodelineno-28-1)transceive(options: TransceiveOptions) => Promise<TransceiveResult>
`

Send raw command to the tag and receive the response.

This method must be called from within a `nfcTagScanned` handler.

On **Android**, the tag must be connected with `connect()` first.

⚠️ **Experimental:** This method could not be tested extensively yet. Please let us know if you discover any issues!

⚠️ **Attention**: A bad command can damage the tag forever. Please read the Android and iOS documentation linked below first.

More information on how to use this method on **Android**: https://bit.ly/3ywSkvT

More information on how to use this method on **iOS** with... - ISO 15693-3: https://apple.co/3Lliaum - FeliCa: https://apple.co/3LpvRs6

Only available on Android and iOS.

| Param       | Type                                    |
| ----------- | --------------------------------------- |
| **options** | [TransceiveOptions](#transceiveoptions) |

**Returns:** `Promise<[TransceiveResult](#transceiveresult)>`

**Since:** 0.3.0

---

### connect(...)[¶](#connect "Permanent link")

`[](#%5F%5Fcodelineno-29-1)connect(options: ConnectOptions) => Promise<void>
`

Connect to the tag and enable I/O operations.

This method must be called from within a `nfcTagScanned` handler.

Only available on Android.

| Param       | Type                              |
| ----------- | --------------------------------- |
| **options** | [ConnectOptions](#connectoptions) |

**Since:** 6.0.0

---

### close()[¶](#close "Permanent link")

`[](#%5F%5Fcodelineno-30-1)close() => Promise<void>
`

Close the connection to the tag.

This method must be called from within a `nfcTagScanned` handler.

Only available on Android.

**Since:** 6.0.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-31-1)isAvailable() => Promise<IsAvailableResult>
`

Returns whether or not NFC is available.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 7.2.0

---

### isSupported()[¶](#issupported "Permanent link")

`[](#%5F%5Fcodelineno-32-1)isSupported() => Promise<IsSupportedResult>
`

Returns whether or not NFC is supported.

**Returns:** `Promise<[IsSupportedResult](#issupportedresult)>`

**Since:** 0.0.1

---

### isEnabled()[¶](#isenabled "Permanent link")

`[](#%5F%5Fcodelineno-33-1)isEnabled() => Promise<IsEnabledResult>
`

Returns whether or not NFC is enabled.

On **iOS** and **Web**, this method reflects whether NFC reading is available on the device. iOS does not expose a global NFC on/off setting.

**Returns:** `Promise<[IsEnabledResult](#isenabledresult)>`

**Since:** 0.0.1

---

### openSettings()[¶](#opensettings "Permanent link")

`[](#%5F%5Fcodelineno-34-1)openSettings() => Promise<void>
`

Opens the NFC device settings so that the user can enable or disable NFC.

Only available on Android.

**Since:** 0.0.1

---

### getAntennaInfo()[¶](#getantennainfo "Permanent link")

`[](#%5F%5Fcodelineno-35-1)getAntennaInfo() => Promise<GetAntennaInfoResult>
`

Returns information regarding Nfc antennas on the device such as their relative positioning on the device.

Only available on Android.

**Returns:** `Promise<[GetAntennaInfoResult](#getantennainforesult)>`

**Since:** 6.1.0

---

### setAlertMessage(...)[¶](#setalertmessage "Permanent link")

`[](#%5F%5Fcodelineno-36-1)setAlertMessage(options: SetAlertMessageOptions) => Promise<void>
`

Set a custom message, which is displayed in the NFC Reader Session alert.

Only available on iOS.

| Param       | Type                                              |
| ----------- | ------------------------------------------------- |
| **options** | [SetAlertMessageOptions](#setalertmessageoptions) |

**Since:** 6.2.0

---

### checkPermissions()[¶](#checkpermissions "Permanent link")

`[](#%5F%5Fcodelineno-37-1)checkPermissions() => Promise<PermissionResult>
`

Check permission for reading and writing NFC tags.

This method is only needed on Web. On Android and iOS, `granted` is always returned.

**Returns:** `Promise<[PermissionResult](#permissionresult)>`

**Since:** 0.0.1

---

### requestPermissions()[¶](#requestpermissions "Permanent link")

`[](#%5F%5Fcodelineno-38-1)requestPermissions() => Promise<PermissionResult>
`

Request permission for reading and writing NFC tags.

This method is only needed on Web. On Android and iOS, `granted` is always returned.

**Returns:** `Promise<[PermissionResult](#permissionresult)>`

**Since:** 0.0.1

---

### addListener('commandReceived', ...)[¶](#addlistenercommandreceived "Permanent link")

`[](#%5F%5Fcodelineno-39-1)addListener(eventName: 'commandReceived', listenerFunc: (event: CommandReceivedEvent) => void) => Promise<PluginListenerHandle>
`

Called whenever a NFC reader sends an Application Protocol Data Unit (APDU).

Only available on Android.

| Param            | Type                                                           |
| ---------------- | -------------------------------------------------------------- |
| **eventName**    | 'commandReceived'                                              |
| **listenerFunc** | (event: [CommandReceivedEvent](#commandreceivedevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.3.0

---

### addListener('nfcLinkDeactivated', ...)[¶](#addlistenernfclinkdeactivated "Permanent link")

`[](#%5F%5Fcodelineno-40-1)addListener(eventName: 'nfcLinkDeactivated', listenerFunc: (event: NfcLinkDeactivatedEvent) => void) => Promise<PluginListenerHandle>
`

Called when the NFC link has been deactivated or lost.

Only available on Android.

| Param            | Type                                                                 |
| ---------------- | -------------------------------------------------------------------- |
| **eventName**    | 'nfcLinkDeactivated'                                                 |
| **listenerFunc** | (event: [NfcLinkDeactivatedEvent](#nfclinkdeactivatedevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.3.0

---

### addListener('nfcTagScanned', ...)[¶](#addlistenernfctagscanned "Permanent link")

`[](#%5F%5Fcodelineno-41-1)addListener(eventName: 'nfcTagScanned', listenerFunc: (event: NfcTagScannedEvent) => void) => Promise<PluginListenerHandle>
`

Called when a new NFC tag is scanned.

| Param            | Type                                                       |
| ---------------- | ---------------------------------------------------------- |
| **eventName**    | 'nfcTagScanned'                                            |
| **listenerFunc** | (event: [NfcTagScannedEvent](#nfctagscannedevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 0.0.1

---

### addListener('scanSessionCanceled', ...)[¶](#addlistenerscansessioncanceled "Permanent link")

`[](#%5F%5Fcodelineno-42-1)addListener(eventName: 'scanSessionCanceled', listenerFunc: () => void) => Promise<PluginListenerHandle>
`

Called when the scan session was canceled.

Only available on iOS.

| Param            | Type                  |
| ---------------- | --------------------- |
| **eventName**    | 'scanSessionCanceled' |
| **listenerFunc** | () => void            |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 0.0.1

---

### addListener('scanSessionError', ...)[¶](#addlistenerscansessionerror "Permanent link")

`[](#%5F%5Fcodelineno-43-1)addListener(eventName: 'scanSessionError', listenerFunc: (event: ScanSessionErrorEvent) => void) => Promise<PluginListenerHandle>
`

Called when an error occurs during the scan session.

| Param            | Type                                                             |
| ---------------- | ---------------------------------------------------------------- |
| **eventName**    | 'scanSessionError'                                               |
| **listenerFunc** | (event: [ScanSessionErrorEvent](#scansessionerrorevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 0.0.1

---

### removeAllListeners()[¶](#removealllisteners "Permanent link")

`[](#%5F%5Fcodelineno-44-1)removeAllListeners() => Promise<void>
`

Remove all listeners for this plugin.

**Since:** 0.0.1

---

### Interfaces[¶](#interfaces "Permanent link")

#### StartScanSessionOptions[¶](#startscansessionoptions "Permanent link")

| Prop                  | Type               | Description                                                                                                                                                                                                | Default                                            | Since |
| --------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | ----- |
| **alertMessage**      | string             | A custom message, which is displayed in the NFC Reader Session alert. Only available on iOS.                                                                                                               |                                                    | 0.0.1 |
| **compatibilityMode** | boolean            | Whether or not to use the [NFCNDEFReaderSession](https://developer.apple.com/documentation/corenfc/nfcndefreadersession). **Attention:** This mode only supports reading NDEF tags. Only available on iOS. | false                                              | 6.4.0 |
| **techTypes**         | NfcTagTechType\[\] | The NFC tag technologies to filter on in this session. Only available on Android.                                                                                                                          |                                                    | 0.0.1 |
| **mimeTypes**         | string\[\]         | Mime types to filter on in this session. Only available on Android.                                                                                                                                        |                                                    | 0.0.1 |
| **pollingOptions**    | PollingOption\[\]  | Type of tags to detect during a polling sequence. Only available on iOS.                                                                                                                                   | \[PollingOption.iso14443, PollingOption.iso15693\] | 0.2.0 |

#### StopScanSessionOptions[¶](#stopscansessionoptions "Permanent link")

| Prop             | Type   | Description                                                                                        | Since |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------- | ----- |
| **errorMessage** | string | A custom error message, which is displayed in the NFC Reader Session alert. Only available on iOS. | 0.0.1 |

#### WriteOptions[¶](#writeoptions "Permanent link")

| Prop        | Type                        | Description                | Since |
| ----------- | --------------------------- | -------------------------- | ----- |
| **message** | [NdefMessage](#ndefmessage) | The NDEF message to write. | 0.0.1 |

#### NdefMessage[¶](#ndefmessage "Permanent link")

| Prop        | Type           | Description                      | Since |
| ----------- | -------------- | -------------------------------- | ----- |
| **records** | NdefRecord\[\] | The records of the NDEF message. | 0.0.1 |

#### NdefRecord[¶](#ndefrecord "Permanent link")

| Prop        | Type                              | Description                                                                                                            | Since |
| ----------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----- |
| **id**      | number\[\]                        | The record identifier as byte array.                                                                                   | 0.0.1 |
| **payload** | number\[\]                        | The payload field data as byte array.                                                                                  | 0.0.1 |
| **tnf**     | [TypeNameFormat](#typenameformat) | The record type name format which indicates the structure of the value of the type field.                              | 0.0.1 |
| **type**    | number\[\]                        | The type of the record payload. This should be used in conjunction with the tnf field to determine the payload format. | 0.0.1 |

#### RespondOptions[¶](#respondoptions "Permanent link")

| Prop     | Type       | Description    | Since |
| -------- | ---------- | -------------- | ----- |
| **data** | number\[\] | Bytes to send. | 6.3.0 |

#### TransceiveResult[¶](#transceiveresult "Permanent link")

| Prop         | Type       | Description                 | Since |
| ------------ | ---------- | --------------------------- | ----- |
| **response** | number\[\] | Bytes received in response. | 0.3.0 |

#### TransceiveOptions[¶](#transceiveoptions "Permanent link")

| Prop                     | Type                              | Description                                                                                                                                                                                                     | Since |
| ------------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **techType**             | [NfcTagTechType](#nfctagtechtype) | The NFC tag technology to connect with. Only available on iOS.                                                                                                                                                  | 0.3.0 |
| **data**                 | number\[\]                        | Bytes to send.                                                                                                                                                                                                  | 0.3.0 |
| **iso15693RequestFlags** | Iso15693RequestFlag\[\]           | The request flags for the NFC tag technology type NfcV (ISO 15693-3). Only available on iOS 14+                                                                                                                 | 0.3.0 |
| **iso15693CommandCode**  | number                            | The custom command code defined by the IC manufacturer for the NFC tag technology type NfcV (ISO 15693-3). Valid range is 0xA0 to 0xDF inclusively, 0x23 and 0x24 are also supported. Only available on iOS 14+ | 0.3.0 |

#### ConnectOptions[¶](#connectoptions "Permanent link")

| Prop         | Type                              | Description                                                        | Since |
| ------------ | --------------------------------- | ------------------------------------------------------------------ | ----- |
| **techType** | [NfcTagTechType](#nfctagtechtype) | The NFC tag technology to connect with. Only available on Android. | 6.0.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop    | Type    | Description                                                          | Since |
| ------- | ------- | -------------------------------------------------------------------- | ----- |
| **hce** | boolean | Whether or not Host Card Emulation (HCE) is available on the device. | 7.2.0 |
| **nfc** | boolean | Whether or not NFC is available on the device.                       | 7.2.0 |

#### IsSupportedResult[¶](#issupportedresult "Permanent link")

| Prop            | Type    | Description                                                          | Since |
| --------------- | ------- | -------------------------------------------------------------------- | ----- |
| **isSupported** | boolean |                                                                      | 0.0.1 |
| **nfc**         | boolean | Whether or not NFC is supported on the device.                       | 6.3.0 |
| **hce**         | boolean | Whether or not Host Card Emulation (HCE) is supported on the device. | 6.3.0 |

#### IsEnabledResult[¶](#isenabledresult "Permanent link")

| Prop          | Type    | Since |
| ------------- | ------- | ----- |
| **isEnabled** | boolean | 0.0.1 |

#### GetAntennaInfoResult[¶](#getantennainforesult "Permanent link")

| Prop                  | Type        | Description                               | Since |
| --------------------- | ----------- | ----------------------------------------- | ----- |
| **availableAntennas** | Antenna\[\] | The available NFC antennas on the device. | 6.1.0 |
| **deviceHeight**      | number      | The height of the device in millimeters.  | 6.1.0 |
| **deviceWidth**       | number      | The width of the device in millimeters.   | 6.1.0 |
| **isDeviceFoldable**  | boolean     | Whether or not the device is foldable.    | 6.1.0 |

#### Antenna[¶](#antenna "Permanent link")

| Prop          | Type   | Description                                                   | Since |
| ------------- | ------ | ------------------------------------------------------------- | ----- |
| **locationX** | number | The location of the NFC antenna on the X axis in millimeters. | 6.1.0 |
| **locationY** | number | The location of the NFC antenna on the Y axis in millimeters. | 6.1.0 |

#### SetAlertMessageOptions[¶](#setalertmessageoptions "Permanent link")

| Prop        | Type   | Description                                                             | Since |
| ----------- | ------ | ----------------------------------------------------------------------- | ----- |
| **message** | string | The custom message, which is displayed in the NFC Reader Session alert. | 6.2.0 |

#### PermissionResult[¶](#permissionresult "Permanent link")

| Prop    | Type                                | Description                                        | Since |
| ------- | ----------------------------------- | -------------------------------------------------- | ----- |
| **nfc** | [PermissionState](#permissionstate) | Permission state for reading and writing NFC tags. | 0.0.1 |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

#### CommandReceivedEvent[¶](#commandreceivedevent "Permanent link")

| Prop     | Type       | Description                                  | Since |
| -------- | ---------- | -------------------------------------------- | ----- |
| **data** | number\[\] | The command received from the remote device. | 6.3.0 |

#### NfcLinkDeactivatedEvent[¶](#nfclinkdeactivatedevent "Permanent link")

| Prop       | Type                                      | Description                               | Since |
| ---------- | ----------------------------------------- | ----------------------------------------- | ----- |
| **reason** | [DeactivationReason](#deactivationreason) | The reason why the deactivation occurred. | 6.3.0 |

#### NfcTagScannedEvent[¶](#nfctagscannedevent "Permanent link")

| Prop       | Type              | Description          | Since |
| ---------- | ----------------- | -------------------- | ----- |
| **nfcTag** | [NfcTag](#nfctag) | The scanned NFC tag. | 0.0.1 |

#### NfcTag[¶](#nfctag "Permanent link")

| Prop                 | Type                        | Description                                                                                         | Since |
| -------------------- | --------------------------- | --------------------------------------------------------------------------------------------------- | ----- |
| **atqa**             | number\[\]                  | The ATQA/SENS\_RES bytes of an NFC A tag. Only available on Android.                                | 0.0.1 |
| **applicationData**  | number\[\]                  | The Application Data bytes from ATQB/SENSB\_RES of an NFC B tag. Only available on Android and iOS. | 0.0.1 |
| **barcode**          | number\[\]                  | The barcode bytes of an NfcBarcode tag. Only available on Android.                                  | 0.0.1 |
| **canMakeReadOnly**  | boolean                     | Whether the NDEF tag can be made read-only or not. Only available on Android.                       | 0.0.1 |
| **dsfId**            | number\[\]                  | The DSF ID bytes of an NFC V tag. Only available on Android.                                        | 0.0.1 |
| **hiLayerResponse**  | number\[\]                  | The higher layer response bytes of an ISO-DEP tag. Only available on Android.                       | 0.0.1 |
| **historicalBytes**  | number\[\]                  | The historical bytes of an ISO-DEP tag. Only available on Android and iOS.                          | 0.0.1 |
| **id**               | number\[\]                  | The tag identifier (low level serial number) which is used for anti-collision and identification.   | 0.0.1 |
| **isWritable**       | boolean                     | Whether the NDEF tag is writable or not. Only available on Android and iOS.                         | 0.0.1 |
| **manufacturer**     | number\[\]                  | The manufacturer bytes of an NFC F tag. Only available on Android and iOS.                          | 0.0.1 |
| **manufacturerCode** | number                      | The Integrated Circuit (IC) manufacturer code of an NFC V tag. Only available on iOS.               | 6.3.0 |
| **maxSize**          | number                      | The maximum NDEF message size in bytes. Only available on Android and iOS.                          | 0.0.1 |
| **message**          | [NdefMessage](#ndefmessage) | The NDEF-formatted message.                                                                         | 0.0.1 |
| **protocolInfo**     | number\[\]                  | The Protocol Info bytes from ATQB/SENSB\_RES of an NFC B tag. Only available on Android.            | 0.0.1 |
| **responseFlags**    | number\[\]                  | The Response Flag bytes of an NFC V tag. Only available on Android.                                 | 0.0.1 |
| **sak**              | number\[\]                  | The SAK/SEL\_RES bytes of an NFC A tag. Only available on Android.                                  | 0.0.1 |
| **systemCode**       | number\[\]                  | The System Code bytes of an NFC F tag. Only available on Android and iOS.                           | 0.0.1 |
| **techTypes**        | NfcTagTechType\[\]          | The technologies available in this tag. Only available on Android and iOS.                          | 0.0.1 |
| **type**             | [NfcTagType](#nfctagtype)   | The NDEF tag type. Only available on Android and iOS.                                               | 0.0.1 |

#### ScanSessionErrorEvent[¶](#scansessionerrorevent "Permanent link")

| Prop        | Type   | Description        | Since |
| ----------- | ------ | ------------------ | ----- |
| **message** | string | The error message. | 0.0.1 |

### Type Aliases[¶](#type-aliases "Permanent link")

#### PermissionState[¶](#permissionstate "Permanent link")

`'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'`

### Enums[¶](#enums "Permanent link")

#### NfcTagTechType[¶](#nfctagtechtype "Permanent link")

| Members              | Value                | Description                                                                   | Since |
| -------------------- | -------------------- | ----------------------------------------------------------------------------- | ----- |
| **NfcA**             | 'NFC\_A'             | The NFC-A (ISO 14443-3A) tag technology. Only available on Android.           | 0.0.1 |
| **NfcB**             | 'NFC\_B'             | The NFC-B (ISO 14443-3B) tag technology. Only available on Android.           | 0.0.1 |
| **NfcF**             | 'NFC\_F'             | The NFC-F (JIS 6319-4) tag technology. Only available on Android and iOS.     | 0.0.1 |
| **NfcV**             | 'NFC\_V'             | The NFC-V (ISO 15693) tag technology. Only available on Android and iOS.      | 0.0.1 |
| **IsoDep**           | 'ISO\_DEP'           | The ISO-DEP (ISO 14443-4) tag technology. Only available on Android.          | 0.0.1 |
| **Iso7816**          | 'ISO\_7816'          | The ISO 7816 tag technology. Only available on iOS.                           | 5.1.0 |
| **Ndef**             | 'NDEF'               | The NDEF tag technology. Only available on Android.                           | 0.0.1 |
| **MifareClassic**    | 'MIFARE\_CLASSIC'    | The MIFARE Classic tag technology. Only available on Android.                 | 0.0.1 |
| **MifareDesfire**    | 'MIFARE\_DESFIRE'    | The MIFARE Desfire tag technology. Only available on iOS.                     | 5.1.0 |
| **MifarePlus**       | 'MIFARE\_PLUS'       | The MIFARE Plus tag technology. Only available on iOS.                        | 5.1.0 |
| **MifareUltralight** | 'MIFARE\_ULTRALIGHT' | The MIFARE Ultralight tag technology. Only available on Android and iOS.      | 0.0.1 |
| **NfcBarcode**       | 'NFC\_BARCODE'       | The technology of a tag containing just a barcode. Only available on Android. | 0.0.1 |
| **NdefFormatable**   | 'NDEF\_FORMATABLE'   | The NDEF formatable tag technology. Only available on Android.                | 0.0.1 |

#### PollingOption[¶](#pollingoption "Permanent link")

| Members      | Value      | Description                                                   | Since |
| ------------ | ---------- | ------------------------------------------------------------- | ----- |
| **iso14443** | 'iso14443' | The option for detecting ISO 7816-compatible and MIFARE tags. | 0.2.0 |
| **iso15693** | 'iso15693' | The option for detecting ISO 15693 tags.                      | 0.2.0 |
| **iso18092** | 'iso18092' | The option for detecting FeliCa tags.                         | 0.2.0 |

#### TypeNameFormat[¶](#typenameformat "Permanent link")

| Members         | Value | Description                                                                                            | Since |
| --------------- | ----- | ------------------------------------------------------------------------------------------------------ | ----- |
| **Empty**       | 0     | An empty record with no type or payload.                                                               | 0.0.1 |
| **WellKnown**   | 1     | A predefined type defined in the RTD specification of the NFC Forum.                                   | 0.0.1 |
| **MimeMedia**   | 2     | An Internet media type as defined in RFC 2046.                                                         | 0.0.1 |
| **AbsoluteUri** | 3     | A URI as defined in RFC 3986.                                                                          | 0.0.1 |
| **External**    | 4     | A user-defined value that is based on the rules of the NFC Forum Record Type Definition specification. | 0.0.1 |
| **Unknown**     | 5     | Type is unknown.                                                                                       | 0.0.1 |
| **Unchanged**   | 6     | Indicates the payload is an intermediate or final chunk of a chunked NDEF Record.                      | 0.0.1 |

#### Iso15693RequestFlag[¶](#iso15693requestflag "Permanent link")

| Members                 | Value                 | Since |
| ----------------------- | --------------------- | ----- |
| **address**             | 'address'             | 0.3.0 |
| **commandSpecificBit8** | 'commandSpecificBit8' | 0.3.0 |
| **dualSubCarriers**     | 'dualSubCarriers'     | 0.3.0 |
| **highDataRate**        | 'highDataRate'        | 0.3.0 |
| **option**              | 'option'              | 0.3.0 |
| **protocolExtension**   | 'protocolExtension'   | 0.3.0 |
| **select**              | 'select'              | 0.3.0 |

#### DeactivationReason[¶](#deactivationreason "Permanent link")

| Members        | Value | Description                                                       | Since |
| -------------- | ----- | ----------------------------------------------------------------- | ----- |
| **LinkLoss**   | 0     | Indicates deactivation was due to the NFC link being lost.        | 6.3.0 |
| **Deselected** | 1     | Indicates deactivation was due to a different AID being selected. | 6.3.0 |

#### NfcTagType[¶](#nfctagtype "Permanent link")

| Members               | Value                   | Description                        | Since |
| --------------------- | ----------------------- | ---------------------------------- | ----- |
| **NfcForumType1**     | 'NFC\_FORUM\_TYPE\_1'   | Only available on Android.         | 0.0.1 |
| **NfcForumType2**     | 'NFC\_FORUM\_TYPE\_2'   | Only available on Android.         | 0.0.1 |
| **NfcForumType3**     | 'NFC\_FORUM\_TYPE\_3'   | Only available on Android and iOS. | 0.0.1 |
| **NfcForumType4**     | 'NFC\_FORUM\_TYPE\_4'   | Only available on Android.         | 0.0.1 |
| **MifareClassic**     | 'MIFARE\_CLASSIC'       | Only available on Android.         | 0.0.1 |
| **MifareDesfire**     | 'MIFARE\_DESFIRE'       |                                    | 0.0.1 |
| **MifarePlus**        | 'MIFARE\_PLUS'          | Only available on Android.         | 0.0.1 |
| **MifarePro**         | 'MIFARE\_PRO'           | Only available on Android.         | 0.0.1 |
| **MifareUltralight**  | 'MIFARE\_ULTRALIGHT'    | Only available on Android.         | 0.0.1 |
| **MifareUltralightC** | 'MIFARE\_ULTRALIGHT\_C' | Only available on Android.         | 0.0.1 |

## Utils[¶](#utils "Permanent link")

This plugin provides a utility class `NfcUtils` that can be used for various NFC-related operations, for example, creating NDEF records:

`[](#%5F%5Fcodelineno-45-1)import { NfcUtils } from '@capawesome-team/capacitor-nfc';
[](#%5F%5Fcodelineno-45-2)
[](#%5F%5Fcodelineno-45-3)const createNdefTextRecord = () => {
[](#%5F%5Fcodelineno-45-4)  const utils = new NfcUtils();
[](#%5F%5Fcodelineno-45-5)  const { record } = utils.createNdefTextRecord({ text: 'Capacitor NFC Plugin' });
[](#%5F%5Fcodelineno-45-6)  return record;
[](#%5F%5Fcodelineno-45-7)};
`

See [docs/utils/README.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/nfc/docs/utils/README.md) for more information.

## Troubleshooting[¶](#troubleshooting "Permanent link")

##### `The connection to service named com.apple.nfcd.service.corenfc was invalidated from this process`[¶](#the-connection-to-service-named-comapplenfcdservicecorenfc-was-invalidated-from-this-process "Permanent link")

This error occurs on iOS when the required NFC capability is not added to the app. To fix this, add the `Near Field Communication Tag Reading` capability in Xcode under the `Signing & Capabilities` tab. See [Add a capability to a target](https://help.apple.com/xcode/mac/current/#/dev88ff319e7) for more information.

## FAQ[¶](#faq "Permanent link")

### What do I need to configure before using the plugin on iOS?[¶](#what-do-i-need-to-configure-before-using-the-plugin-on-ios "Permanent link")

You need to enable the `Near Field Communication Tag Reading` capability in Xcode, make sure the `App.entitlements` file contains the `com.apple.developer.nfc.readersession.formats` key, and add the `NFCReaderUsageDescription` key to the `Info.plist` file to tell the user why the app needs to use NFC. See the [Installation](#installation) section for details. If the capability is missing, the scan session fails with an error, as described in the [Troubleshooting](#troubleshooting) section.

### Is Host Card Emulation (HCE) available on all platforms?[¶](#is-host-card-emulation-hce-available-on-all-platforms "Permanent link")

No, card emulation is only available on Android. The `respond(...)` method and the `commandReceived` event are Android-only, and you need to declare an HCE service in your `AndroidManifest.xml` as described in the [Installation](#installation) section. You can check whether HCE is supported on the device using the `isSupported()` method.

### Can I launch my app by scanning an NFC tag?[¶](#can-i-launch-my-app-by-scanning-an-nfc-tag "Permanent link")

Yes. On Android, you need to add an intent filter to your `AndroidManifest.xml` as described in the [Android documentation](https://developer.android.com/guide/topics/connectivity/nfc/nfc#dispatching). On iOS, the tag requires a URI record containing either a universal link or a supported URL scheme, as described in the [Core NFC documentation](https://developer.apple.com/documentation/corenfc/adding%5Fsupport%5Ffor%5Fbackground%5Ftag%5Freading#3032598). See the [Installation](#installation) section for details.

### What is the difference between `isSupported` and `isEnabled`?[¶](#what-is-the-difference-between-issupported-and-isenabled "Permanent link")

The `isSupported()` method returns whether the device supports NFC and Host Card Emulation (HCE) at all, while the `isEnabled()` method returns whether NFC is currently enabled. On Android, you can open the NFC device settings with `openSettings()` so that the user can enable NFC. On iOS and Web, `isEnabled()` reflects whether NFC reading is available on the device, since iOS does not expose a global NFC on/off setting.

### Can making an NFC tag read-only be undone?[¶](#can-making-an-nfc-tag-read-only-be-undone "Permanent link")

No, the `makeReadOnly()` method permanently write-protects the tag and cannot be undone. On Android, you can check the `canMakeReadOnly` property of the scanned tag to find out whether it can be made read-only at all.

### Can I use this plugin with Ionic, React, Vue or Angular?[¶](#can-i-use-this-plugin-with-ionic-react-vue-or-angular "Permanent link")

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

## Related Plugins[¶](#related-plugins "Permanent link")

* [Bluetooth Low Energy](https://capawesome.io/docs/sdks/capacitor/bluetooth-low-energy/): Communicate with Bluetooth Low Energy (BLE) devices in the central and peripheral role.
* [ML Kit Barcode Scanning](https://capawesome.io/docs/sdks/capacitor/mlkit/barcode-scanning/): Scan barcodes and QR codes with ML Kit Barcode Scanning.
* [Wifi](https://capawesome.io/docs/sdks/capacitor/wifi/): Manage Wi-Fi connectivity, including adding, connecting, and disconnecting networks.

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/nfc/CHANGELOG.md).

## Breaking Changes[¶](#breaking-changes "Permanent link")

See [BREAKING.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/nfc/BREAKING.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/nfc/LICENSE).

July 8, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/nfc/#article", "headline": "Capacitor NFC Plugin for Android, iOS & Web", "name": "Capacitor NFC Plugin for Android, iOS & Web", "description": "Capacitor plugin for NFC tag reading, writing, and emulation. Supports Android, iOS, and Web with advanced features like HCE and raw command handling.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/nfc/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/nfc/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/nfc/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/nfc/#software", "name": "Capacitor NFC Plugin for Android, iOS & Web", "description": "Capacitor plugin for NFC tag reading, writing, and emulation. Supports Android, iOS, and Web with advanced features like HCE and raw command handling.", "url": "https://capawesome.io/docs/sdks/capacitor/nfc/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "What do I need to configure before using the plugin on iOS?", "acceptedAnswer": {"@type": "Answer", "text": "You need to enable the Near Field Communication Tag Reading capability in Xcode, make sure the App.entitlements file contains the com.apple.developer.nfc.readersession.formats key, and add the NFCReaderUsageDescription key to the Info.plist file to tell the user why the app needs to use NFC. See the Installation section for details. If the capability is missing, the scan session fails with an error, as described in the Troubleshooting section."}}, {"@type": "Question", "name": "Is Host Card Emulation (HCE) available on all platforms?", "acceptedAnswer": {"@type": "Answer", "text": "No, card emulation is only available on Android. The respond(...) method and the commandReceived event are Android-only, and you need to declare an HCE service in your AndroidManifest.xml as described in the Installation section. You can check whether HCE is supported on the device using the isSupported() method."}}, {"@type": "Question", "name": "Can I launch my app by scanning an NFC tag?", "acceptedAnswer": {"@type": "Answer", "text": "Yes. On Android, you need to add an intent filter to your AndroidManifest.xml as described in the Android documentation. On iOS, the tag requires a URI record containing either a universal link or a supported URL scheme, as described in the Core NFC documentation. See the Installation section for details."}}, {"@type": "Question", "name": "What is the difference between isSupported and isEnabled?", "acceptedAnswer": {"@type": "Answer", "text": "The isSupported() method returns whether the device supports NFC and Host Card Emulation (HCE) at all, while the isEnabled() method returns whether NFC is currently enabled. On Android, you can open the NFC device settings with openSettings() so that the user can enable NFC. On iOS and Web, isEnabled() reflects whether NFC reading is available on the device, since iOS does not expose a global NFC on/off setting."}}, {"@type": "Question", "name": "Can making an NFC tag read-only be undone?", "acceptedAnswer": {"@type": "Answer", "text": "No, the makeReadOnly() method permanently write-protects the tag and cannot be undone. On Android, you can check the canMakeReadOnly property of the scanned tag to find out whether it can be made read-only at all."}}, {"@type": "Question", "name": "Can I use this plugin with Ionic, React, Vue or Angular?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects."}}], "url": "https://capawesome.io/docs/sdks/capacitor/nfc/"}
```
