Skip to content

[iOS][FIX] resend to Flutter all tags, even if there's no NDEF data written#248

Open
dlopez-penbase wants to merge 1 commit intookadan:mainfrom
dlopez-penbase:fix/unable_to_scan_nfc_tags_with_no_data
Open

[iOS][FIX] resend to Flutter all tags, even if there's no NDEF data written#248
dlopez-penbase wants to merge 1 commit intookadan:mainfrom
dlopez-penbase:fix/unable_to_scan_nfc_tags_with_no_data

Conversation

@dlopez-penbase
Copy link
Copy Markdown

PR related to issue #244

I fixed the regression by forcing native code to send data to Flutter no matter what, even if there's no NDEF data inside of them

@dlopez-penbase dlopez-penbase changed the title [FIX] resend to Flutter all tags, even if there's no NDEF data written [iOS][FIX] resend to Flutter all tags, even if there's no NDEF data written Sep 24, 2025
@mvn-quannguyen2-dn
Copy link
Copy Markdown

mvn-quannguyen2-dn commented Oct 8, 2025

Hello @okadan Cc @dlopez-penbase

My project is also facing a similar issue, could you release this patch, thank you so much!!!

@JernejPoligram
Copy link
Copy Markdown

+1

@dlopez-penbase
Copy link
Copy Markdown
Author

@mvn-quannguyen2-dn @JernejPoligram
I released a version in my local repository, all is noted in the readme if you need to import it in your project :

https://github.com/dlopez-penbase/flutter-nfc-manager

@jeremy-giles
Copy link
Copy Markdown

Hello, the fix proposed by @dlopez-penbase resolves the similar issue we were experiencing: tags not being detected by the latest version of the library (4.1.1).

Here's a log excerpt from when reading an undetected tag, with no errors.
par défaut 08:46:02.197499+0100 nfcd -[_NFReaderSession _sync_connect:completion:]:662 Runner (1318) _NFReaderSession-790847160.401237 par défaut 08:46:02.197999+0100 nfcd -[NFDriverWrapper connectTag:]:67 Connecting to tag: <NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 } par défaut 08:46:02.205374+0100 nfcd -[NFDriverWrapper disconnectTag:tagRemovalDetect:]:121 disconnecting from tag: <NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 }, tagRemovalDetect=0 par défaut 08:46:02.209775+0100 nfcd -[NFDriverWrapper connectTag:]:67 Connecting to tag: <NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 } par défaut 08:46:02.223547+0100 nfcd -[NFDriverWrapper queryTagNDEFCapability:hasNdefAbility:error:]:200 read=1 write=1 capacity=233, messageSize=0 tag=<NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 } par défaut 08:46:02.224637+0100 nfcd -[_NFReaderSession ndefReadWithCompletion:]:965 Runner (1318) _NFReaderSession-790847160.401237 par défaut 08:46:02.225145+0100 nfcd -[NFDriverWrapper disconnectTag:tagRemovalDetect:]:121 disconnecting from tag: <NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 }, tagRemovalDetect=0 par défaut 08:46:02.230370+0100 nfcd -[NFDriverWrapper connectTag:]:67 Connecting to tag: <NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 } par défaut 08:46:02.242456+0100 nfcd -[NFDriverWrapper queryTagNDEFCapability:hasNdefAbility:error:]:200 read=1 write=1 capacity=233, messageSize=0 tag=<NFTagInternal: 0x9e8b222a0>-2440FF0B46987309 { Tech=A Type=MiFare ID=1654BD1A9A5E2B silentType=0 SAK=(null) ATQA=(null) sfgi=0x0 } erreur 08:46:02.246650+0100 nfcd NFDriverRemoteDevReadNdef:5627 phLibNfc_Ndef_Read failed: 0x009d par défaut 08:46:02.247095+0100 nfcd -[NFDriverWrapper readNdefDataFromTag:messageSize:error:]:307 zero-length message par défaut 08:46:02.249274+0100 nfcd -[_NFReaderSession _sync_restartPolling:]:1577 Runner (1318) _NFReaderSession-790847160.401237 par défaut 08:46:02.249756+0100 nfcd -[NFPowerAssertion releasePowerAssertion:]:129 ExpressMode does not hold assertion

stokkeAtMonta added a commit to monta-app/flutter-nfc-manager that referenced this pull request Mar 19, 2026
When NDEF query or read returns an error (e.g. blank NTAG213 tags),
return the tag pigeon instead of nil so the tag is still surfaced to
Flutter's onDiscovered callback rather than being silently dropped.

Ref: okadan#248
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.

4 participants