<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd" -->

---
title: The iOS NFC Handbook: How to Read, Write and Lock NFC...
description: A deep, hands-on handbook for building NFC tag reading and writing into a React Native iOS app, covering the Apple provisioning gauntlet (paid account, App ID,...
canonical: https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The iOS NFC Handbook: How to Read, Write and Lock NFC Tags with React Native | daily.dev
og:description: A deep, hands-on handbook for building NFC tag reading and writing into a React Native iOS app, covering the Apple provisioning gauntlet (paid account, App ID,...
og:url: https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd
og:image: https://api.daily.dev/og/posts/ExmxLi6pd.png
og:image:alt: The iOS NFC Handbook: How to Read, Write and Lock NFC Tags with React Native
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The iOS NFC Handbook: How to Read, Write and Lock NFC Tags with React Native

**[freeCodeCamp](https://daily.dev/sources/freecodecamp)** · 66 min read · 0 upvotes · 0 comments

## Summary

A deep, hands-on handbook for building NFC tag reading and writing into a React Native iOS app, covering the Apple provisioning gauntlet (paid account, App ID, entitlements), CoreNFC's session-based API quirks, writing a custom NDEF decoder after finding bugs in a popular library, encoding vCards within tag byte limits, building a focus timer that requires walking to a physical tag to stop, why NFC-based locks aren't cryptographically secure, four platform-specific CoreNFC gotchas (deallocated sessions, race conditions, entitlement errors, CocoaPods file globbing), and why Apple's Secure Element makes Tap-to-Pay emulation impossible on iOS unlike Android. The author documents two of their own wrong conclusions (assumed iOS couldn't report tag capacity, and NTAG213's true usable size being 137 bytes rather than 144) and ultimately replaces the third-party NFC library with a custom Swift native module.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.freecodecamp.org/news/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native>

## Questions this post answers

### How many usable bytes does an NTAG213 actually have for an NDEF message, not the advertised 144?

An NTAG213 has 144 bytes of user memory, but the maximum NDEF message size is smaller, around 137 bytes, because the tag wraps the message in its own TLV (type, length, value) bookkeeping. Developers who use the full 144-byte figure for capacity checks end up seven bytes too generous, telling users a card fits when it does not.

_Anyone budgeting vCard size on NFC tags can save capacity-planning headaches by tracking these gotchas on daily.dev._

### Can CoreNFC on iOS report how much data an NFC tag can hold?

Yes, despite the common assumption that it cannot. The getTag() call only returns an id and tech field with no size information, which can wrongly suggest iOS has no way to report capacity. But calling queryNDEFStatus (exposed as getNdefStatus in react-native-nfc-manager) inside the same session returns both a read/write status and the real capacity measured from the tag itself.

_Developers debating whether to write native modules for missing iOS capabilities can compare notes like this on daily.dev._

### Why does my CoreNFC NFC read session silently disappear with no error on iOS?

The session object gets deallocated by Swift's Automatic Reference Counting before it finishes, which happens if it's stored in a local variable inside the function that started it; once that function returns, the variable and the session go away with no error logged. The fix is to retain the session in a property that outlives the function call, such as an instance property on the module.

_iOS developers chasing silent CoreNFC failures can track platform-specific gotchas like this on daily.dev._

## Similar posts on daily.dev

- [No Flutter NFC Package Could Do Both, So I Built One](https://daily.dev/posts/no-flutter-nfc-package-could-do-both-so-i-built-one-akpa7osxw) · ProAndroidDev · 2 upvotes · 0 comments
- [How to Make a Wi-Fi NFC Tag So Guests Connect With One Tap](https://daily.dev/posts/how-to-make-a-wi-fi-nfc-tag-so-guests-connect-with-one-tap-mkweiq8ui) · Medium · 0 upvotes · 0 comments
- [NFC tap-to-pay gets tapped by hackers](https://daily.dev/posts/nfc-tap-to-pay-gets-tapped-by-hackers-qihxjff0m) · CSO Online · 0 upvotes · 0 comments
- [NFC tags are the simplest smart home automation I actually use every day](https://daily.dev/posts/nfc-tags-are-the-simplest-smart-home-automation-i-actually-use-every-day-uy0jg0h0t) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#ios](https://daily.dev/tags/ios), [#swift](https://daily.dev/tags/swift), [#react-native](https://daily.dev/tags/react-native)

[View this post on daily.dev](https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The iOS NFC Handbook: How to Read, Write and Lock NFC Tags with React Native","url":"https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd"},"datePublished":"2026-09-19T21:51:02.249Z","dateModified":"2026-09-19T21:51:28.968Z","description":"A deep, hands-on handbook for building NFC tag reading and writing into a React Native iOS app, covering the Apple provisioning gauntlet (paid account, App ID,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/74fdffea9d60573505a921cd416c2f9f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/74fdffea9d60573505a921cd416c2f9f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"freeCodeCamp","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"freeCodeCamp","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1628412854/logos/freecodecamp","url":"https://daily.dev/sources/freecodecamp"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ios,swift,react-native","timeRequired":"PT66M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"freeCodeCamp","item":"https://daily.dev/sources/freecodecamp"},{"@type":"ListItem","position":3,"name":"The iOS NFC Handbook: How to Read, Write and Lock NFC Tags with React Native"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-ios-nfc-handbook-how-to-read-write-and-lock-nfc-tags-with-react-native-exmxli6pd#faq","mainEntity":[{"@type":"Question","name":"How many usable bytes does an NTAG213 actually have for an NDEF message, not the advertised 144?","acceptedAnswer":{"@type":"Answer","text":"An NTAG213 has 144 bytes of user memory, but the maximum NDEF message size is smaller, around 137 bytes, because the tag wraps the message in its own TLV (type, length, value) bookkeeping. Developers who use the full 144-byte figure for capacity checks end up seven bytes too generous, telling users a card fits when it does not. Anyone budgeting vCard size on NFC tags can save capacity-planning headaches by tracking these gotchas on daily.dev."}},{"@type":"Question","name":"Can CoreNFC on iOS report how much data an NFC tag can hold?","acceptedAnswer":{"@type":"Answer","text":"Yes, despite the common assumption that it cannot. The getTag() call only returns an id and tech field with no size information, which can wrongly suggest iOS has no way to report capacity. But calling queryNDEFStatus (exposed as getNdefStatus in react-native-nfc-manager) inside the same session returns both a read/write status and the real capacity measured from the tag itself. Developers debating whether to write native modules for missing iOS capabilities can compare notes like this on daily.dev."}},{"@type":"Question","name":"Why does my CoreNFC NFC read session silently disappear with no error on iOS?","acceptedAnswer":{"@type":"Answer","text":"The session object gets deallocated by Swift's Automatic Reference Counting before it finishes, which happens if it's stored in a local variable inside the function that started it; once that function returns, the variable and the session go away with no error logged. The fix is to retain the session in a property that outlives the function call, such as an instance property on the module. iOS developers chasing silent CoreNFC failures can track platform-specific gotchas like this on daily.dev."}}]}
```

