App2 Conclusion

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the The newline Guide to NFCs with React Native course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to The newline Guide to NFCs with React Native, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course The newline Guide to NFCs with React Native
  • [00:00 - 00:08] Hello, we have learned a lot in this module. Let's do a review here.

    [00:09 - 00:22] We started our n-deaf journey by writing n-deaf into NFC tags with NFC tools app. And we also try to write a naive test case to parse it.

    [00:23 - 00:29] Then we formally study the n-deaf. Some important points to keep in mind.

    [00:30 - 00:48] n-deaf message is an array of n-deaf record. To know what kind of payload is inside the n-deaf record, we need to check both TNF in the header and the type field. TNF1 refers to well-known TNF.

    [00:49 - 01:09] In this case, the type field maps to record type definition, or RTD for short, which is another spec defined by an NFC forum. Once we confirm the payload type, we can then decode and encode the payload accordingly.

    [01:10 - 01:28] In this module, our payload type is RTDURI, which can encode lots of different URI types into n-deaf record. Then we walk through how to use our NFC library to process n-deaf.

    [01:29 - 01:54] For encoding, we have factory method for common n-deaf records, such as URI record and text record, as well as an encode message function to group multiple n-deaf records into one n-deaf message. For decoding, we provide constants for TNF and common RTD.

    [01:55 - 02:15] Once you confirm which payload type you are dealing with, you can call a specific decode payload method to parse the actual payload, to actually write or read n-deaf from our mobile device. We also learn how to request a specific NFC technology handler.

    [02:16 - 02:25] In our case here, it's the n-deaf handler. This pattern will also be used in the next module.

    [02:26 - 02:42] These specific NFC technology handlers provide technology related operations for us to use. In our case here, since we are dealing with n-deaf, it is the write n-deaf message API.

    [02:43 - 03:00] There are also several technology independent APIs we can use, such as Get Tech , which resolves to the NFC tag object we just found. Finally, we show you how to use deep linking with NFC tags.

    [03:01 - 03:18] In order to use this technique, several native setup are required according to different mobile platforms. For iOS, we mainly rely on custom URL types, so we modify our info.plist to include it.

    [03:19 - 03:34] For Android, we register for a special intent called n-deaf discovered, along with the custom URL i-s game. I hope you enjoyed and have learned something along this journey.

    [03:35 - 03:50] In the next module, we will move even further to see how we can deal with specific tech types beyond n-deaf. By utilizing specific hardware features, we can build even more interesting applications.

    [03:51 - 03:51] I will see you there.