Altova MobileTogether Designer

NFC-Related Events

Home Prev Top Next

You can specify what actions to perform when two NFC-related events (see screenshots below) are triggered.

 

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.

 

To access these actions, go to Styles & Properties Pane | Project Properties | NFC Actions property, and click the property's Additional Dialog button.

 

OnPushNdefMessageCompleted

This event is triggered when a message or file has been successfully transmitted and can be used to specify subsequent action to take. For example, the solution's user can be informed about the completion of transmission, as shown in the screenshot below.

MTNFCEventOnPushNDEFCompleted

See also Pushing Data to Other Devices.

 

OnNfcTagDiscovered

When an NFC tag is discovered, the information in it is automatically read and stored in the $MT_NFC tree. This event enables you to specify any additional actions you might want to carry out. For example, as shown in the screenshot below, page-source 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 page-source 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.

MTNFCEventOnNFCTagDiscovered

See also Discovering and Reading NFC Tags.

 

© 2018-2024 Altova GmbH