js-apis-nfcTag.md 1.8 KB
Newer Older
A
Annie_wang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
# Standard NFC Tag

This module is used to manage Near-Field Communication (NFC) tags.

> **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.


## **Modules to Import**

```
import tag from '@ohos.nfc.tag';
```


## tag.getNfcATag

getNfcATag(tagInfo: TagInfo): NfcATag

Obtains the **NfcATag** object, which allows access to the tags that use the NfcA technology.

**Required permissions**: ohos.permission.NFC_TAG

**System capability**: SystemCapability.Communication.NFC

**Return value**

| **Type**| **Description**|
| -------- | -------- |
| NfcATag | **NfcATag** object obtained.|

## tag.getNfcBTag

getNfcBTag(tagInfo: TagInfo): NfcBTag

Obtains the **NfcBTag** object, which allows access to the tags that use the NfcB technology.

**Required permissions**: ohos.permission.NFC_TAG

**System capability**: SystemCapability.Communication.NFC

**Return value**

| **Type**| **Description**        |
| -------- | ---------------- |
| NfcBTag  | **NfcBTag** object obtained.|

## tag.getNfcFTag

getNfcFTag(tagInfo: TagInfo): NfcFTag

Obtains the **NfcFTag** object, which allows access to the tags that use the NfcF technology.

**Required permissions**: ohos.permission.NFC_TAG

**System capability**: SystemCapability.Communication.NFC

**Return value**

| **Type**| **Description**        |
| -------- | ---------------- |
| NfcFTag  | **NfcFTag** object obtained.|

## tag.getNfcVTag

getNfcVTag(tagInfo: TagInfo): NfcVTag

Obtains the **NfcVTag** object, which allows access to the tags that use the NfcV technology.

**Required permissions**: ohos.permission.NFC_TAG

**System capability**: SystemCapability.Communication.NFC

**Return value**

| **Type**| **Description**        |
| -------- | ---------------- |
| NfcVTag  | **NfcVTag** object obtained.|