Two NFC-related events (screenshots below) provide valuable functionality:
•OnPushNdefMessageCompleted specifies what action/s to carry out when the transmission of NFC data (via NFC Push) has been completed.
•OnNfcTagDiscovered specifies what (additional) action/s to carry out when an NFC tag is discovered.
This event is triggered when a message or file has been successfully transmitted. It can be used (i) to specify subsequent action to take, or (ii) to inform the user about the completion of the transmission. The screenshot below shows how the event can be used.
See also Pushing Data to Other Devices.
This event is triggered when an NFC tag is discovered. When a tag is discovered, the information in it is automatically read and stored in the $MT_NFC tree. This event enables you to specify additional actions to carry out. For example, as shown in the screenshot below, source-tree nodes can be updated with data from the Payload attribute of the $MT_NFC tree's NdefRecord element.
Note that the Payload attribute will have its content in hexBinary format. If the payload is known to be carrying a text string, then the extension function mt-hexBinary-to-string can be used to obtain the text string before placing the string in a source-tree node (see the first Update Node action in the screenshot below). Similarly, if the payload is expected to carry an image, then the hexBinary content of the payload can be converted to a Base64 encoding of the image by using the mt-hexBinary-to-base64 extension function.
See also Discovering and Reading NFC Tags.