首页 > 解决方案 > 用 nfc_manager 获取卡数据?

问题描述

我正在使用 nfc_manager 包来扫描我的交通卡。我在 Playstore 上发现了类似的应用程序,它们能够从应用程序中获取交易历史记录、卡序列号和其他详细信息。但是,使用 nfc_manager 包,我只能获得 isodep 和 nfcB 数据。下面是 isoep 和 nfcb 数据的打印输出。

{identifier: [123, 123,123,123], hiLayerResponse: [], historicalBytes: null, isExtendedLengthApduSupported: true, maxTransceiveLength: 12312, timeout: 123}
{identifier: [123,123,123,123], applicationData: [0, 0, 0, 0], maxTransceiveLength: 123, protocolInfo: [123,123,123]}

(值已更改为 123,因为我不确定数据是否敏感)我如何从我这里的数据中获取诸如运输历史之类的数据?或者这是包装的限制?

这是使用的代码:

 NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
       print(tag.data['isodep']);
       print(tag.data['nfcb']);

       IsoDep isoDep = IsoDep.from(tag);
       print(isoDep.historicalBytes);
     });

谢谢您的帮助!

标签: flutterdartnfc

解决方案


推荐阅读