2

I have developed an android app with HCE function and want to send the string to iPhone by CoreNFC. So I have used NFCReaderiOS, this example to verify whether success or not. The following code is the android part that I used to return data to the iOS NFC reader app:

@Override
public byte[] processCommandApdu(byte[] bytes, Bundle bundle) {
    if (Arrays.equals(bytes, APDU_SELECT)) {
        NdefMessage message = createTextMessage("Testing123");
        return message.toByteArray();
    } else {
        return A_ERROR;
    }
}

However, the iOS NFC reader app cannot capture any response that the android part returned. In this case, the function processCommandApdu is triggered by the iOS reader app. Is there any solution to emulate the NDEF tag by android HCE other than the above method? Thanks a lot.

Nikos Hidalgo
  • 3,666
  • 9
  • 25
  • 39
CodeMonkey
  • 94
  • 2
  • Did you find anything which allows sending data to Android HCE from iOS? I'm kinda stuck at the same problem. – Purush Pawar Mar 30 '20 at 05:50
  • I'm sorry that I couldn't figure out how to send data to Android HCE from iOS. But I found that whenever I wrote data to Android HCE, the iOS writer would show "NFC tag is not writable"...I'm not sure whether this is the root cause – CodeMonkey Mar 30 '20 at 05:55

1 Answers1

1

I do not think that iOS supports anything other than the NDEF APDU.

Section 5 of http://apps4android.org/nfc-specifications/NFCForum-TS-Type-4-Tag_2.0.pdf Should provide all the details how how to correctly emulate a type 4 tag with an NDEF message on it.

Also some more details on https://stackoverflow.com/a/29127714/2373819

Andrew
  • 8,198
  • 2
  • 15
  • 35