js-apis-nfcTag.md 1.8 KB
Newer Older
A
Annie_wang 已提交
1 2
# Standard NFC Tag

A
Annie_wang 已提交
3
Manages Near-Field Communication (NFC) tags.
A
Annie_wang 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

> **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

A
Annie_wang 已提交
20
Obtains an **NfcATag** object, which allows access to the tags that use the NFC-A technology.
A
Annie_wang 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

**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

A
Annie_wang 已提交
36
Obtains an **NfcBTag** object, which allows access to the tags that use the NFC-B technology.
A
Annie_wang 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

**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

A
Annie_wang 已提交
52
Obtains an **NfcFTag** object, which allows access to the tags that use the NFC-F technology.
A
Annie_wang 已提交
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

**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

A
Annie_wang 已提交
68
Obtains an **NfcVTag** object, which allows access to the tags that use the NFC-V technology.
A
Annie_wang 已提交
69 70 71 72 73 74 75 76 77 78

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

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

**Return value**

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