don / phonegap-nfc-reader

PhoneGap NFC reader demo
101 stars 79 forks source link

"undefined" on NFC reader #10

Closed cilluo closed 10 years ago

cilluo commented 10 years ago

my code is


function ArletndefMessage(nfcEvent) {

var tag = nfcEvent.tag, ABCD = tag.ndefMessage;

   alert(ABCD);

}

I always show "undefined"

but I can read only ID by

function ArletndefMessage(nfcEvent) {

var tag = nfcEvent.tag, ABCD = tag.id;

   alert(ABCD);

}

how can I read other Value (tag.ndefMessage, tag.type, tag.maxsize)?

thanks.

don commented 10 years ago

The nfcEvent contains a tag object. You can access other properties with the dot notation. e.g. tag.maxSize

See the docs for an example of the tag object https://github.com/chariotsolutions/phonegap-nfc#sample-event-on-android

don commented 10 years ago

Duplicate of https://github.com/chariotsolutions/phonegap-nfc/issues/132