Mike
Mike

Reputation: 11

Text and URL together on an NFC tag

Is it possible to program an NFC tag with text and a URL that can be linked to a website so when you tap it, the message will then cause a browser to open and take you to the website?

Example:
Hello my name is Mike click here to go to my website.

Upvotes: 1

Views: 1452

Answers (2)

Michael Roland
Michael Roland

Reputation: 40841

This depends on what platform you are using to read the NFC tag. In general, you can attach human-readable text to a URL on an NFC tag by using the Smart Poster record type. The Smart Poster record type contains one URI record and one or more Text records as its payload:

 +---------+---------------------------------------+
 | Type    | Sp                                    |
 +---------+---------------------------------------+
 | Payload | +---------+-------------------------+ |
 |         | | Type    | U                       | |
 |         | +---------+-------------------------+ |
 |         | | Payload | http://www.example.com/ | |
 |         | +---------+-------------------------+ |
 |         | +---------+-------------------------+ |
 |         | | Type    | T                       | |
 |         | +---------+-------------------------+ |
 |         | | Payload | Language = "en"         | |
 |         | |         | Text = "My website"     | |
 |         | +---------+-------------------------+ |
 +---------+---------------------------------------+

Unfortunately, the human-readable description is not used by all platforms.

  • Android: The built-in Tags app would display the textual description of Smart Poster records and would allow the user to open the URL only after clicking on it. However, all web browsers that support opening URLs received through NFC override this default behavior. Instead, these browser immediately open the URL and do not show the textual description. So the only way to achieve what you want on Android would be to create a custom app (which all users would have to have installed on their devices) that triggers upon your tag, displays the message and lets the user click a button in order to launch the URL in a web browser.

  • Blackberry: Blackberry supports the Smart Poster record. The text and the URL are displayed to the user and confirmation is requested before the URL is opened in the web browser.

Upvotes: 2

William Lai
William Lai

Reputation: 127

I think there are 2 items to be modified.

The web site should be able to read data from URI. Ex. "http://www.google.com/?q=HelloWorld"

And your tag content can be configured as NDEF well-known URI and filled ID=0x01 ("http://www.") and content is "google.com/?q=HelloWorld". Thus when you tap the phone, it'll lunch browser with URI "http://www.google.com/?q=HelloWorld"

Upvotes: 0

Related Questions