Launch an app
Closed this issue · 4 comments
Armaldio commented
Is it possible to launch an app while scanning the nfc shield ?
(Like an AAR Android Application Record)
xiongyihui commented
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);
Armaldio commented
Oh thank you very much.
i'll try that tomorow :)
don commented
Thanks @xiongyihui
Armaldio commented
Works like a charm ;) Ty again.