App2 Conclusion
Hello, we have learned a lot in this module. Let's do a review here.
We started our NDEF
journey by writing NDEF
into NFC
tags with NFC Tools
app, and we also tried to write a naive test case to parse it.
NDEF review#
Then, we formally studied the NDEF
. Some important points to keep in mind:
NdefMessage
is an array ofNdefRecord
To know what kind of payload is inside the
NdefRecord
, we need to check bothTNF
in the header and theType field
.TNF
1 refers toWELL_KNOWN
TNF. In this case, theType field
maps toRecord Type Definition
, orRTD
for short, which is another spec defined by NFC Forum.Once we confirm the payload type, we can then decode and encode the payload accordingly. In this module, our payload type is
RTD_URI
, which can encode lots of different URI types intoNdefRecord
.
How to process NDEF in React Native#
Then, we walked through how to use our NFC library to process NDEF.
This page is a preview of The newline Guide to NFCs with React Native