Altova MobileTogether Designer

NFC Push

Home Prev Top Next

The NFC Push action (screenshot below) defines the message or file to push. When the action is triggered, the specified message or file is transmitted via NFC. In order for the Push action to work, the NFC Start action must be triggered already—so that the device is ready for the Push action. Once an NFC Push action has been started, the NFC message or file will be transmitted to any receiving device that is placed within NFC range of the sending device. This continuous sending is stopped (i) when NFC is stopped or (ii) when an NFC Push action is canceled (which is done by adding a new NFC Push action with the Cancel option selected; see the action's screenshot below).


Each NFC Push action can specify either:


Push: To start the pushing of a message. Each NFC Push action corresponds to one message to be transmitted. Note, however, that a message can consist of multiple records. For example, the message in the screenshot above contains three records. If you want to send more than one message, then add a new NFC Push action for each message.

Cancel: To cancel the the pushing of a message. Add the NFC Push action and use the action's Cancel option to stop any message pushing that has been previously triggered by some other NFC Push action..


Pushing a message

The NFC Push option enables you to define the NFC message that you want to transmit. In the combo box (see screenshot below), select the Standard Type of the message to be transmitted. These types are as defined in the NFC technical specifications.


Text, URI, and MIME-Media types

Definitions of the Text, URI, and MIME Media standard types are straightforward (but see the URI options below the next screenshot). The screenshot below shows an NFC message with three records, each of which defines a different standard type. Message contents can be XPath strings, or can come from source tree nodes. In the last record, for example, the message's contents are taken from a node in an XML page source.


The following URI options are available:


SMS URI: The sent SMS will be opened in the receiving device's SMS app. The URI would look something like this: "sms:+439991234567?body=MyBody"

Telephone URI: The telephone app on the receiving device will be opened, and the transmitted telephone number will be dialed. Example URI: "tel:+439991234567"

Email URI: The sent email will be opened in the receiving device's email app. Example URI: ""



In some types of messages (see the NFC technical specifications), the message content must be explicitly converted to hexBinary so that it can be stored and transported in the payload of the NFC message. If you wish to convert a string to hexBinary, you can use the XPath extension function mt-string-to-hexBinary. Images can be converted from Base64 to hexBinary with the mt-base64-to-hexBinary function. When an NFC payload is received on a device (see Discovering and Reading NFC Tags), the hexBinary can be converted back to a string or a Base64 image by using, respectively, the XPath extension functions mt-hexBinary-to-string and mt-hexBinary-to-base64.



Pushing images

If you wish to transmit an image via an NFC Push message, you can do this by using the relevant MIME media type for that image (see screenshot below for an example). When defining this kind of message, you will need to convert the Base64 format of the image to hexBinary so that the image can be transported in the payload of the NFC message. For this conversion, use the XPath extension function mt-base64-to-hexBinary. To convert the hexBinary (on the receiving device) back to a Base64 image, use the function mt-hexBinary-to-base64.


Advanced types

For messages that are of the Advanced type, a specific advanced type must be selected (see screenshot below). For each advanced type, enter the respective text and specify any other relevant information.


For a description of NFC's advanced types, see the NFC technical specifications.


Canceling a push/beam

The Cancel action enables you to cancel a previously triggered push action that has not been stopped.



MobileTogether extension functions

MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.




© 2018-2024 Altova GmbH