nfc: NfcTag cannot read the id and kind either platform sends, so scan fails from Rust

Open Beginner friendly
#3,780 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
77/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust, tauri

Research direction

Read plugins/nfc/src/models.rs:80-87 and compare its NfcTag fields with the payloads in android/src/main/java/NfcPlugin.kt:416-419 and ios/Sources/NfcPlugin.swift:174-177. Check the Rust scan deserialization tests or entry point to see how these values are consumed. Done means responses from both platforms deserialize successfully, including a tag with no identifier.

Written by the indexing model from the issue text.

Description

tauri-plugin-nfc 2.4.2, and plugins/nfc/src/models.rs on the default branch as of 2026-11-08.

NfcTag declares id: String and kind: String (plugins/nfc/src/models.rs:80-87). Both platforms send arrays for these fields:

  • Android sends id as the identifier's bytes (ret.put("id", fromU8Array(tag.id)), android/src/main/java/NfcPlugin.kt:416) and kind as the tag's technology list (ret.put("kind", JSArray.from(tag.techList)), :419).
  • iOS sends kind as a one-element list (metadata["kind"] = ["MiFare"], ios/Sources/NfcPlugin.swift:176) and id as the identifier's bytes, or nothing for FeliCa (:174, :177).

So Nfc::scan called from Rust fails to deserialise the response for every tag it reads. #2272 reported the mismatch and is closed as completed, but the struct is unchanged in 2.4.2 and on the default branch.

A shape that reads what both platforms send: id: Option<Vec<u8>> and kind: Vec<String>.

Dominant language
Rust
Stars
1.8k
Forks
637
Avg merge
5d 3h
Merged PRs (30d)
36

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tauri-apps/plugins-workspace

All issues in tauri-apps/plugins-workspace

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.