Sharing contacts using QR Code without requiring a network connection


I was reading website today and saw an intriguing post about sharing contacts using QR Codes. I have worked with that in the past and clicked the link to see the solution. The author came up with a working solution that is easy to replicate and will work well, but I want to present another solution here. One that I used a lot in 2013/2015 and it still works well.

In the mentioned post, the author ends up hosting a vCard file in a web-accessible Github repository and then creating a QR Code with the URL to the file. A simple and elegant solution.

I used that in the past too but I noticed that there was an edge case that hurt me a lot. Some conventions and meetups have horrible internet connections. It is not unusual for a conference center, specially one full of developers carrying a multiple connected devices, to have its own network go down. Or even worse, you’re so deep inside a building that you don’t have mobile reception.

The lack of a reliable connection during events is something that happened more often ten years ago, but it is still a problem. You don’t need a network connection to share contacts using QR Codes.

Yes, you read that right, you can use a different format instead of URL to share contact details. The format is MeCard. This format is similar to vCard format but much more concise, wasting fewer bytes to make QR Encoding easier.

So while a vCard might look like:

FN:Simon Perreault
N:Perreault;Simon;;;ing. jr,M.Sc.

A MeCard looks like:


Simply QR Encoding the MeCard string will just work. The decoding app will see it as a valid contact card. There is no network request, no need to upload a file to a web server.

Conference Engagement App

I spent many years travelling around doing tech talks all over the world and eventually developed some throwaway apps to help me engage with people after the talks. I rewrote that app in lots of different languages, it is one of the first things I reimplement when learning a new language or framework.

It had two main features. One was to allow me to quickly fire an email with the topics I talked about and links to more reference material. That didn’t involve a request either. It would simply load markdown files into a very long mailto: URL and open the default mail client pre-filled with the information. I would just need to press send and the email would sit on my outbox until a stable connection was available. Also, it helped exchanging emails with people.

Sending topics relevant to my talk was easy...
Sending topics relevant to my talk was easy...

The other feature was just contact sharing, which used a MeCard generated from data stored in localStorage.

Sharing contact was also easy
Sharing contact was also easy

This app was developed for FirefoxOS so it would be installed and offline-first on the phone.

And it still works, look at the iPhone cam recognising the contact.
And it still works, look at the iPhone cam recognising the contact.

The source for that app is online. Be aware that this is something I threw together for my own personal usage. This is not production code such as you’d see working on a proper job. It still do the job though.

Did you enjoyed reading this content? Want to support me?

You can buy me a coffee at ko-fi.

Comments? Questions? Feedback?

You can reach out to me on Twitter, or Mastodon, Secure Scuttlebutt, or through WebMentions.