Skip to content

fix(iOS): don't fail tag discovery when readNDEF errors on blank tags#268

Open
harSofja wants to merge 1 commit into
okadan:mainfrom
harSofja:fix/blank-ntag213-ios-discovery
Open

fix(iOS): don't fail tag discovery when readNDEF errors on blank tags#268
harSofja wants to merge 1 commit into
okadan:mainfrom
harSofja:fix/blank-ntag213-ios-discovery

Conversation

@harSofja

@harSofja harSofja commented Apr 17, 2026

Copy link
Copy Markdown

Problem

Blank/unformatted NTAG213 tags pass queryNDEFStatus with .readWrite but fail readNDEF (e.g. zero-length message). The previous guard only suppressed error 403, so blank tags caused completionHandler(nil, error) and onDiscovered never fired in Flutter. Now any readNDEF error returns the pigeon without a cached message, keeping the tag discoverable and writable.

Fix

When readNDEF fails for any reason, return completionHandler(pigeon, nil)
instead of propagating the error. The pigeon already contains the correct
NDEF status and capacity from queryNDEFStatus, so Flutter can discover the
tag and the app can proceed to write NDEF records normally.

This mirrors how .notSupported status is handled, we never fail the whole
discovery, we just omit the cached message.

Tested on

  • iOS with blank NTAG213 tags (no existing NDEF records)

Blank/unformatted NTAG213 tags pass queryNDEFStatus with .readWrite but
fail readNDEF (e.g. zero-length message). The previous guard only suppressed
error 403, so blank tags caused completionHandler(nil, error) and onDiscovered
never fired in Flutter. Now any readNDEF error returns the pigeon without a
cached message, keeping the tag discoverable and writable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant