Categories
.NET NFC

NFC support for all Uri types

In order to save a few bytes, there is a special mechanism used in Uri NFC tags where one byte is reserved to match with specific Uri prefixes. A value of zero means the following text contains the full Uri, a value of one means the Uri starts with “http://www.”. There are actually 35 of these constants in total.

How this behaves depends on the platform – Android handles this for you and returns a valid Uri, but on iOS you receive the raw bytes and must use this initial byte and the rest of the data to reconstruct the full Uri. InTheHand.Nfc needs to handle this transparently for you and support all the Uri types. On iOS we had previously only handled the first few common Uri types and so there might be situations where it wouldn’t return the full valid Uri. This is now resolved in v1.2.4 so if you need to scan a telnet: Uri from an NFC tag this now works as expected!

You can download the latest version from NuGet. This release also adds specific .NET 10.0 builds. InTheHand.Nfc now provides a feature complete implementation of the WebNFC standard for your .NET mobile apps.

Peter Foot's avatar

By Peter Foot

Microsoft Windows Development MVP

One reply on “NFC support for all Uri types”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.