react-native-nfc-manager icon indicating copy to clipboard operation
react-native-nfc-manager copied to clipboard

Host Card Emulation

Open jlkalberer opened this issue 10 months ago • 7 comments

Hi,

I am doing a bit of work to add Host Card Emulation since iOS now supports it as of 17.4.

I was wondering how you'd prefer I expose these APIs (or if you even want them in this package)? Should I try to shoe-horn it into the requestTechnology/registerTagEvent flow or just add a new API specific to this feature?

I am tackling Android first since I'm more comfortable there but I just wanted to get some feedback before I open a PR.

jlkalberer avatar Jan 03 '25 20:01 jlkalberer

Hi John,

That will be great!

I would love to see this feature included in current package. The main reason is:

  • When users develop a HCE based app, they normally need a corresponding reader side app. A library integrate both sides will make the developement easier.

For the API side, I will suggest to separate these new APIs from any existing APIs, including "registerTagEvent", because:

  • API naming: for HCE, we don't listen to "tag", but wait for the "reader"
  • flow: card emulation normally requires more setup flow than tag reading

Look forwards to see your upcoming PR, and I will definitely look into this with you!

Thanks

whitedogg13 avatar Jan 05 '25 02:01 whitedogg13

Hi!

Any update on this?

Thanks

DylanWard14 avatar Feb 26 '25 22:02 DylanWard14

Life got in the way a bit haha.

I'll try to push up the changes I made. I can't remember where I left off with things but I think I broke my NFC chip as I was working on it.

jkalberer avatar Feb 26 '25 23:02 jkalberer

No worries. Would love to see this feature implemented.

DylanWard14 avatar Feb 26 '25 23:02 DylanWard14

That would be great!

+1

bitsmyth avatar Feb 27 '25 05:02 bitsmyth

I won't be able to work on this further but it's pretty close to being done (I think). https://github.com/revtel/react-native-nfc-manager/pull/770

I tried to set things up so that it works with existing codepaths instead of having a bunch of net-new code.

Also, I was only focused on having the card emulate a tag + data. I wasn't making it programmable or anything.

jlkalberer avatar Mar 10 '25 15:03 jlkalberer

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 09 '25 02:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 25 '25 02:06 github-actions[bot]

Just a note, I've implemented a separate module that covers the HCE for both Android and iOS: https://github.com/icedevml/react-native-host-card-emulation

It might be a helpful reference if you would like to port that stuff into React Native NFC Manager, otherwise I welcome any pull requests as well.

icedevml avatar Sep 13 '25 16:09 icedevml