Skip to content

Commit a359811

Browse files
committed
nfctag: fixing iOS 13 incompatibility
With iOS 13 Apple added support for writing NFC Tags. However, the Apps I tried so far require the TAG to be formated for NDEF. Unformatted tags are rejected. The smallest valid NDEF message has an empty record and an end marker 0xFE.
1 parent 3dfa0b0 commit a359811

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

modules/NFCTag.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NFCTag
77
* KEYWORDS: NFC, Tag, NDEF
88

99
The [NFC Tag module](/modules/NFCTag.js) emulates a basic NFC Forum *Type 2 Tag*
10-
with up to 1k of storage. The storage may be read and written by a NFC Reader as
10+
with up to 1k of storage. The storage may be read and written by an NFC Reader as
1111
well as JS code.
1212

1313
Background
@@ -29,23 +29,29 @@ prior passing `data` into the module.
2929
Example
3030
-------
3131

32-
This example creates an empty 768-byte Tag. The table below describes the six
32+
This example creates an empty 768-byte Tag. The table below describes the 9
3333
initializer bytes used on the second line:
3434

3535
| Index | Value | Explanation |
3636
|-------|-------|-----------------------------------------------------------|
3737
| 0 | 0x00 | Dynamic Lock Bits 0-7 (0x00 denotes no restriction) |
3838
| 1 | 0x00 | Dynamic Lock Bits 8-15 (0x00 denotes no restriction) |
3939
| 2 | 0xE1 | Magic number (Tag contains NFC Forum defined data) |
40-
| 3 | 0x11 | Version (Major and Minor of nfc spec supported, v1.1) |
40+
| 3 | 0x10 | Version (Major and Minor of nfc spec supported, v1.0) |
4141
| 4 | 0x60 | Memory size (value multiplied by 8: 0x60 * 8 = 768 bytes) |
4242
| 5 | 0x00 | Read and Write access (0x00 denotes no restriction) |
43+
| 6 | 0x03 | Block contains an NDEF message |
44+
| 7 | 0x00 | Empty NDEF Record |
45+
| 8 | 0xFE | Last TLV block in the data area |
4346

44-
It is writtable using almost any NFC Reader e.g. an Android phone (using [NFC TagWriter by NXP](https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter)).
47+
It is writtable using almost any NFC Reader e.g. an Android phone
48+
(using [NFC TagWriter by NXP](https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter))
49+
or an iPhone with iOS 13+
50+
(using [NFC Tools by wakdev](https://apps.apple.com/ch/app/nfc-tools/id1252962749))
4551

4652
```
4753
var data = new Uint8Array(16+768);
48-
data.set("\x00\x00\xE1\x11\x60\x00", 0x0A);
54+
data.set("\x00\x00\xE1\x10\x60\x00\x03\x00\xFE", 0x0A);
4955
var tag = require("NFCTag").create(data);
5056
```
5157

0 commit comments

Comments
 (0)