我可以从 NFC 标签的序列号中获得更多信息吗?

问题描述 投票:0回答:1

我想使用 NFC 显示卡号。但我只能从 nfc 标签获取 uid。 我正在使用 nfc_manager 包 我的代码是这样的:

void _tagRead() {
    NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
      var _tag = tag.data["isodep"]["identifier"]
          .map((e) => e.toRadixString(16).padLeft(2, '0'))
          .join('');
      NfcManager.instance.stopSession();
    });
  }

不明白我能用这个 ID 做什么?

android ios flutter nfc cardreader
1个回答
0
投票

您可以通过以下方式获取价值

if (_tag.ndef != null && _tag.ndef.isNotEmpty) {
  NdefRecord record = _tag.ndef[0].records[0];
  String value = String.fromCharCodes(record.payload);
  print(value);
}

这将为您提供 NFC 中存储的内容。

© www.soinside.com 2019 - 2024. All rights reserved.