how to get uri
k3v1n-uncle opened this issue · 2 comments
k3v1n-uncle commented
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
sant0s commented
@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
representshttp://www.
- the remaining bytes represent the rest of the URI
Harry-Chen commented
@sant0s Thanks for your reply!