# getNFCAdapter()

Gets the NFC adapter

## Support

App capability | Android | iOS | PC | Harmony | Preview
---|---|---|---|---|---
Gadget | <md-version>V3.38.0+<md-version> | V5.25.0+ | **X** | V7.35.0+ | Preview
Web app | V3.44.0+ | V5.25.0+ | **X** | V7.35.0+ | Preview

## Input
None

## Output

Return value: `NFCAdapter`. The following table lists the methods of this object:
**Notice**：To view the supported versions and descriptions of an API, click its name in the following table.

Method | Description
---|---
[getNfcA](https://open.feishu.cn/document/uYjL24iN/ugzM4YjL4MDO24COzgjN) | Gets an NFC-A instance, which supports read/write of NFC-A (ISO 14443-3A) cards
[getNfcB](https://open.feishu.cn/document/uYjL24iN/uUzM4YjL1MDO24SNzgjN/getnfcb) | Gets an NFC-B instance, which supports read/write of NFC-B (ISO 14443-3B) cards<br>**Notice**：Supported by Feishu [V7.15](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and later
[getNfcV](https://open.feishu.cn/document/uYjL24iN/uUzM4YjL1MDO24SNzgjN/getNfcV) | Gets an NFC-V instance, which supports read/write of NFC-V (ISO 15693) cards<br>**Notice**：Supported by Feishu [V5.14](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and later
[getIsoDep](https://open.feishu.cn/document/uYjL24iN/uUzM4YjL1MDO24SNzgjN/getisodep) | Gets an IsoDep instance, which supports read/write of ISO-DEP (ISO 14443-4) cards<br>**Notice**：Supported by Feishu [V7.15](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and later
[getMifareClassic](https://open.feishu.cn/document/uYjL24iN/uEDN4YjLxQDO24SM0gjN) | Gets a MifareClassic instance, which supports read and write of MIFARE Classic tags
[getNdef](https://open.feishu.cn/document/uYjL24iN/uUzM4YjL1MDO24SNzgjN/nfcadapter_getndef) | Gets a Ndef instance, which supports read and write of NDEF tags<br>**Notice**：Supported by Feishu [V7.48](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/version-compatibility) and later
[startDiscovery](https://open.feishu.cn/document/uYjL24iN/uIDN4YjLyQDO24iM0gjN) | Starts scanning NFC tags
[stopDiscovery](https://open.feishu.cn/document/uYjL24iN/uMDN4YjLzQDO24yM0gjN) | Disables NFC tag scanning
[onDiscovered](https://open.feishu.cn/document/uYjL24iN/uUDN4YjL1QDO24SN0gjN) | Listens on NFC tags
[offDiscovered](https://open.feishu.cn/document/uYjL24iN/uQDN4YjL0QDO24CN0gjN) | Cancels listening on NFC tags

##  Sample code

```js
const adapter = tt.getNFCAdapter()
```

## Error code
If a `fail` object is returned, an [errno property](https://open.feishu.cn/document/uYjL24iN/uAjMuAjMuAjM/errno) that indicates the error code will be contained.

For more information about error codes, refer to [NFC API Error Codes](https://open.feishu.cn/document/uYjL24iN/uQzM4YjL0MDO24CNzgjN/nfc-error-codes).
