don/NDEF

Launch an app

Closed this issue · 4 comments

Is it possible to launch an app while scanning the nfc shield ?
(Like an AAR Android Application Record)

Yes, just add an AAR record to your NDEF message.

const uint8_t aarType[] = "android.com:pkg";
const uint8_t aarPayload[] = "com.seeedstudio.nfcdemo";    // Your app package name
NdefRecord aarRecord = NdefRecord();
NdefMessage message = NdefMessage();

aarRecord.setTnf(TNF_EXTERNAL_TYPE);
aarRecord.setType(aarType, sizeof(aarType) - 1);
aarRecord.setPayload(aarPayload, sizeof(aarPayload) - 1);
message.addRecord(aarRecord);

Oh thank you very much.
i'll try that tomorow :)

don commented

Works like a charm ;) Ty again.