Hello, I want to access to the information of a NFC tag. For now, I can access the tag, but I don’t know how to get the messages from the Intent because the return type is an array.
This is the example code from: NFC basics | Android Developers
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
And this is my code in javascript:
var mActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic.<AndroidJavaObject>("currentActivity");
var mIntent = mActivity.Call.<AndroidJavaObject>("getIntent");
var sAction = mIntent.Call.<String>("getAction");
if(sAction=="android.nfc.action.NDEF_DISCOVERED")
{
var mNdefMessage = mIntent.Call.<AndroidJavaObject>("getParcelableArrayExtra", "android.nfc.extra.NDEF_MESSAGES");
}
How can I get an array from an AndroidJavaObject call?
Any idea?
Thanks in advance,
Joel