capacitor-community / proposals

Plugin and platform requests ✋
74 stars 2 forks source link

NFC Host-based card emulation plugin #218

Open thangman22 opened 1 week ago

thangman22 commented 1 week ago

Plugin Request

Name: nfc-hce Package: @capacitor-community/nfc-hce

Platform(s)

Existing Solutions

Currently I develop my own plugin https://www.npmjs.com/package/capacitor-hce-plugin to solve this problem. but still support only Android

Description

This plugin will help the developer emulate NDEF NFC directly from the phone. It is a different NFC plugin from those in this market because standard NFC plugins only provide read/write capability, while this one offers emulator capabilities. Now iOS 17.4 already supports NFC HCE, this plugin should benefit both Android / iOS platforms.

robingenz commented 1 week ago

Great work! Thank you for your contribution to the Capacitor community.

It is a different NFC plugin from those in this market because standard NFC plugins only provide read/write capability, while this one offers emulator capabilities.

I just want to point out that the Capacitor NFC plugin from Capawesome also offers support for HCE, since you mention other plugins here: https://github.com/capawesome-team/capacitor-plugins/issues/155#issuecomment-2157753574 ^^

thangman22 commented 3 days ago

@robingenz I appreciate you mentioning about Capacitor NFC plugin. This plugin is designed specifically for HCE with NDEF format, not full NFC support like Capacitor NFC, Which will not overlap with Capacitor NFC. Unfortunately, even the stable Capacitor NFC doesn't support HCE yet. Also, HCE implementation is quite robust for NDEF emulation, still need some work, and isn't ready to use for this usecase

That's why I'm developing a simpler HCE plugin. Learning the Bytearray response for ADPU commands is challenging, and I want to make it easier for everyone.