okadan / flutter-nfc-manager

A Flutter plugin for accessing the NFC features on Android and iOS.
https://pub.dev/packages/nfc_manager
MIT License
211 stars 134 forks source link

the resulat is different with a lector in windows #34

Open wrjcs opened 4 years ago

wrjcs commented 4 years ago

Hello, I use this plugin to read the mifare card. this is the data read by plugin: {nfca: {identifier: [199, 255, 228, 52], atqa: [4, 0], maxTransceiveLength: 253, sak: 8, timeout: 618}, mifareclassic: {identifier: [199, 255, 228, 52], blockCount: 64, maxTransceiveLength: 253, sectorCount: 16, size: 1024, timeout: 618, type: 0}, ndefformatable: {identifier: [199, 255, 228, 52]}} an this is the data read by lector in windows: 0887422919

How can I read the same data as the lector in windows? Thanks.

almogdadjabir commented 2 years ago

Hello, I faced the same problem in the end I found a solution:

    final ndef = Ndef.from(tag);
    var payload = ndef!.cachedMessage!.records[0].payload;
    var sub = payload.sublist(payload[0] + 1);
    String tagRecordText = String.fromCharCodes(sub);
    result.value = tagRecordText;
    print("${tagRecordText}");