Back to guides

One NFC Wi-Fi Tag for iPhone and Android: Add a URL Fallback

Make one NFC Wi-Fi tag for iPhone and Android: write the Wi-Fi record first, then add a URL record as a fallback page. Here is why the order matters.

Published

Write the Wi-Fi record first, then a URL record

For an NFC Wi-Fi tag that works for iPhone and Android guests, put two records on one tag: a Wi-Fi record first and a URL record second. Android can act on the first. Builders report the iPhone skips the Wi-Fi record, so the URL record is its way in.

The two records

The Wi-Fi record. It is a MIME-type NDEF record with the type application/vnd.wfa.wsc. The payload is a list of tag/value fields. SparkFun's example shows it starting with the Wi-Fi credential identifier 0x100E, with the network name and key stored as attributes inside. You won't build those bytes by hand. For the field-level detail, see the WSC record explained.

The URL record. It is a well-known type U record: a prefix byte for things like https://www., then the rest of the address. Point it at a page you control that shows the network name and password in plain text, plus a QR code of the same credentials.

Record 1: MIME  application/vnd.wfa.wsc   (Wi-Fi credentials)
Record 2: URI   https://example.com/wifi   (fallback page)

What Android does with the tag

Android's tag dispatch docs say the system reads the first record in the message to decide how to interpret it. A MIME record maps to a MIME type. That is why the Wi-Fi record goes first.

There's a second reason the URL shouldn't lead. From Android 16, tags that store http:// or https:// links trigger a view intent. From Android 17, they surface an "open link" notification that needs a tap. A link in front of the Wi-Fi record would mean a browser, not a network join.

One caveat: the Android docs describe how dispatch works. They don't say what each phone maker's Wi-Fi settings do with a Wi-Fi record. Test it on the phones your guests use.

What an iPhone does with the tag

Apple's Core NFC talk says background tag reading works with any NDEF tag whose message includes a URL record. It adds that only the first discovered URL record is processed. So the Wi-Fi record in front doesn't hide your URL. The iPhone goes looking for the URL.

What happens next depends on the link. A valid Universal Link routes to its app. Anything else goes to Safari by default. A normal web address therefore opens your fallback page, which is what you want here. More on this in background tag reading.

On the Wi-Fi side, builders say the iPhone won't join from the Wi-Fi record. One maker programmed a working Wi-Fi tag, found it doesn't work on an iPhone, and asked Apple to support it. A forum report on iOS 17.4.1 says the same. These are individual reports, not an Apple statement. See why iPhone can't auto-join Wi-Fi from a tag.

Two iPhone details: background reading needs the phone unlocked at least once after boot, and Apple lists iPhone XS, XS Max and XR as supported (later models work too, per the NFC Forum).

Write it and test it

  1. Write the Wi-Fi record with the network name, security type and password.
  2. Add the URL record after it.
  3. Read the tag back and check that the Wi-Fi record is first.
  4. Tap it with an Android phone and an iPhone, on the OS versions your guests use.
  5. Check that the fallback page loads and the password on it is right.

NFCore, our iOS and Android app, can write both records to one tag, so you don't need two apps. Get it on the App Store or Google Play.

Anyone who taps the tag can read the password. Use a guest network, not your main one.

The short version

Wi-Fi record first, URL record second. Android sees the first record, the iPhone finds the URL, and your guests end up with the password either way.

Frequently Asked Questions

Can an iPhone join Wi-Fi straight from an NFC tag?

Builders report that it doesn't offer to join from a Wi-Fi record, while a URL record works. We found no Apple statement on it, so test on your iOS version.

Does the order of records matter?

Yes. Android uses the first record to decide how to handle the tag. The iPhone processes the first URL record it finds in the message.

Is it safe to put a Wi-Fi password on a tag?

Anyone who taps it can read the password. Use a guest network and change the password if the tag goes missing.