capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

feat(nfc): Android Beam Message

Open dnx-xy opened this issue 2 years ago • 9 comments

Hi Dev, I was wondering is this plugin capable sending push message from what ever content being sent (Android Beam)

Thanks and regards

dnx-xy avatar Aug 18 '23 03:08 dnx-xy

Thank you for your request! Android Beam ist not yet supported. I will take a closer look at it after my vacation. If it fits the plugin, I'll add it to the roadmap.

robingenz avatar Aug 18 '23 06:08 robingenz

One more thing, is this plugins capable of reading nfc tag of it self (on the device).

I'm not seeing anywhere. Thanks and regards

dnx-xy avatar Aug 25 '23 11:08 dnx-xy

@1stblood You mean if the plugin can host a nfc tag on the device itself (host-based card emulation)? No, this is not yet possible. Currently, you can only read and write nfc tags.

robingenz avatar Aug 25 '23 11:08 robingenz

No I mean. hmm I mean is there a way to know the ID of your own NFC tag

On Fri, 25 Aug 2023, 18:36 Robin Genz, @.***> wrote:

@1stblood https://github.com/1stblood You mean if the plugin can host a nfc tag on the device itself (host-based card emulation)? No, this is not yet possible. Currently, you can only read and write nfc tags.

— Reply to this email directly, view it on GitHub https://github.com/capawesome-team/capacitor-plugins/issues/126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKYQX4FKPS6G4IPIBLVFHLXXCE4PANCNFSM6AAAAAA3U6OJIM . You are receiving this because you were mentioned.Message ID: @.***>

dnx-xy avatar Aug 25 '23 12:08 dnx-xy

Yes, you can read the tag ID using the "transceive" method. But you have to find the correct command in the specification of your nfc tag. This is an example (for NTAG 215 I think):


const readSignature = async () => {
  return new Promise((resolve) => {
    Nfc.addListener('nfcTagScanned', async (event) => {
      const { response } = await Nfc.transceive({ techType: NfcTagTechType.NfcA, data: [60, 0] });
      await Nfc.stopScanSession();
      resolve(response);
    });

    Nfc.startScanSession();
  });
};

robingenz avatar Aug 25 '23 12:08 robingenz

Thanks, I'll check it out. But can I read without knowing specification of my nfc tag. Just curious, cuz I need the id of this nfc tag so I can do something with that.

Thanks

On Fri, 25 Aug 2023, 19:47 Robin Genz, @.***> wrote:

Yes, you can read the tag ID using the "transceive" method. But you have to find the correct command in the specification of your nfc tag. This is an example (for NTAG 215 I think):

const readSignature = async () => { return new Promise((resolve) => { Nfc.addListener('nfcTagScanned', async (event) => { const { response } = await Nfc.transceive({ techType: NfcTagTechType.NfcA, data: [60, 0] }); await Nfc.stopScanSession(); resolve(response); });

Nfc.startScanSession();

});};

— Reply to this email directly, view it on GitHub https://github.com/capawesome-team/capacitor-plugins/issues/126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKYQX2GMAM3XG7MTSM3DHLXXCNH3ANCNFSM6AAAAAA3U6OJIM . You are receiving this because you were mentioned.Message ID: @.***>

dnx-xy avatar Aug 25 '23 12:08 dnx-xy

No, you need to know which command you have to use.

robingenz avatar Aug 25 '23 15:08 robingenz

hi @robingenz , team member of @1stblood here. We are wondering if the plugin can tell us the ID of your own NFC tag. So not the one I would read from another phone. But can I know in advance what someone else would read if they were to read my phones' NFC tag?

We're basically seeing if we can first connect ones own (temporary) NFC tag ID to ones user account. And then when 2 phones bump, and read each others NFC data, we want to find back which user they bumped phones with.

So our end goal is connecting 2 people by them bumping their phones

flyon avatar Aug 26 '23 05:08 flyon

Hi @flyon, got it now. Unfortunately, it seems like this is not possible, see https://stackoverflow.com/a/53481156/6731412. I also couldn't find any API.

robingenz avatar Aug 26 '23 05:08 robingenz

I'm closing this issue because Android Beam has been deprecated since Android 10, see Android Beam deprecation.

However, I have recently added support for HCE: https://github.com/capawesome-team/capacitor-plugins/issues/155#issuecomment-2157753574

robingenz avatar Jun 24 '24 07:06 robingenz