Altova MobileTogether Designer

Discovering and Reading NFC Tags

Home Prev Top Next

When an NFC Start/Stop action is added to the design, a page source named $MT_NFC is automatically added to the design. It is this page source that will, at run time, hold the NFC data that is discovered in an NFC tag.

 

At run time, if NFC has been started via a solution's NFC Start action, then NFC tag discovery starts automatically. If a tag is discovered, then the NFC message in it will be automatically received and the information in the message will be stored in the $MT_NFC tree. The complete structure of the tree is given below. Note that an NDEF message can contain multiple NDEF records, and the NDEF records can be recursive. If the NFC tag information that is received does not contain information to fill all the attributes of the NDEFMessage or NDEFRecord elements, then these attributes will not be created in the $MT_NFC tree.

 

 

The information in the $MT_NFC tree can be processed further and displayed in the same way as other page source data. For example, the $MT_NFC/Root/Tag/NdefMessage/NdefRecord/@Text node can be linked to a label in order to display the message text in the label.

 

Note:Additional actions to take when an NFC tag is discovered can be specified via the tab of the OnNfcTagDiscovered event.

 

Note:Information from an NFC tag will overwrite any information that might already exist in the $MT_NFC tree. So each subsequently discovered tag will replace the information of the previous tag in the $MT_NFC tree.

 

© 2018-2024 Altova GmbH