Skip to content

Instantly share code, notes, and snippets.

@evenevan
Created August 25, 2023 20:36
Show Gist options
  • Save evenevan/3a1794bf7f3c648408930c1e2fd04ec9 to your computer and use it in GitHub Desktop.
Save evenevan/3a1794bf7f3c648408930c1e2fd04ec9 to your computer and use it in GitHub Desktop.
Share your contact information in a fun way with a NFC tag. Compatible with both Android and iOS.

Introduction

Share your contact information in a fun way with a NFC tag.

Compatibility

The resulting NFC tag is compatible with both iOS and Android, see the notes for additional information.

Guide

This process will probably take you about 5-10m to create a vCard, about 5-10m to host your .vcf file, and 5m to write the vCard to your NFC tag.

Prerequisites

  • A NFC chip/coin/tag/card/sticker with ~500 bytes of usable space, see the notes for additional information.
    • I suggest using NTAG215-based NFC tags.
    • Unless you want them quickly, I would highly suggest buying it from a place like AliExpress, as I paid half as much as compared to Amazon's offerings.
  • Somewhere to host and share a .vcf file, such as Google Drive, OneDrive, or HTTP server.

1. Creating the vCard

A vCard is a standard format that allows for the sharing of various information that represents an individual or entity.

To create a vCard, you can use various online tools such as any of the following (no affiliation):

You can also the app NFC Tools (which is used later on) to directly generate a contact onto the NFC tag, but this guide will assume you make a .vcf file first.

You should be aware that contact apps may not accept/recognize/show some of the fields the vCard generators have, such as social media links, images, or some types of emails and phone numbers (such as work, school, cell, and home).

2. Hosting the .vcf File

iPhones are currently unable to read/process a lot of NFC data types, including vCards. To get around this, the NFC tag can store a link pointing to a .vcf file online, which iPhones can then read and present a fancy menu for.

Upload your .vcf file to a platform that you trust and ideally can't be discovered by others easily. For example, you probably don't want to upload your .vcf file to a no-name or random hosting site nor have it visible on GitHub.

Once you've uploaded your file, you will want to create a direct download link for your .vcf file if it doesn't automatically download when you visit the share link. To do this, search [platform] create direct download link and follow a tutorial.

3. Write to the NFC Card

It is time to write your vCard to the NFC tag.

NFC Tools (Android) (iOS) is a popular utility for reading and writing NFC tags. This portion of the guide will be specific to NFC Tools, although I'm sure that you can generalize the steps to other NFC apps.

  1. Go to the Other category and select Format memory.
  2. Go to the Write category, select Add a record, and then select Data at the very bottom.
  3. Set the content type to text/vcard and copy the contents of the .vcf file into the data field. If you made the .vcf on another device, there are many ways to transfer the data, such as emailing or messaging it to yourself.
  4. Press OK, select Add a record, and then choose URL/URI.
  5. Enter the direct download link to your .vcf file.
  6. Ensure that the text/vcard record is ABOVE the URL record, this is important for compatibility on both Android and iPhone. Drag and rearrange the records if they are in the wrong order.
  7. Press Write/xXX Bytes and follow the instructions to write to the NFC tag.

Done! Give it a test, make any adjustments to the vCard, and share it with others.

Notes

  • It appears that only the iPhone 7 and up are able to read NFC tags.
  • Some Android devices do not have NFC capabilities or may have the functionality turned off.
  • Higher capacity NFC tags seem to take longer to read, you'll likely want to get one with a capacity as close to your use case as possible.

Credit

Thanks to Nicolo Stanciu and his article on NFC business cards for the method on getting vCards to work on iPhones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment