nfcim/flutter_nfc_kit

how to get uri

k3v1n-uncle opened this issue · 2 comments

for (var record in await FlutterNfcKit.readNDEFRecords(cached: false)) {
debugPrint(record.toString());
}
the result: [UriRecord: id=(empty) typeNameFormat=TypeNameFormat.nfcWellKnown type=U uri=https://github.com/nfcim/flutter_nfc_kit]
now, I want get the "uri=https://github.com/nfcim/flutter_nfc_kit" for string type, But I do not know how to do! please help me! thanks

@k3v1n-uncle record.payload will give you the payload as a string in hexadecimal:

  • the first byte i.e. the first 2 hexadecimal characters represents the URI prefix. for example, 01 represents http://www.
  • the remaining bytes represent the rest of the URI

@sant0s Thanks for your reply!