nfcim/flutter_nfc_kit

How do I share a text across devices using NFC?

varunlohade opened this issue · 6 comments

I couldnt find this anywhere, but how do i send text across devices, I want to transfer some information(String) from one phone to another.
Can this be done?

What you need is the standard sharing API and Android Beam https://developer.android.com/training/beam-files?hl=zh-cn. You can not programmatically do this via NFC APIs.

so I will need to write some native code right?
and use method channels to use this?
but then this wont work for IOS because it doesnt have similar feature

As far as I know, no native code is needed. You can just use some flutter package like https://pub.dev/packages/share_plus to do this. But you cannot force users to select NFC sharing, which is only one of the possible methods to share content.

For iOS, no such way is available according to my knowledge.

Right now I am trying to share a text from one phone to another(mostly Android), The fastest way to do this was using NFC.
Is there a way this can be possible, I noticed that Tag Type is ISO 14443-4
and IsoDep, NfcA

So is there a possibility to do this right now?

@varunlohade Most probably the 'tag' you read from another phone is a virtual card emulated by Android / eSe. It is not possible to transfer information via this, as the virtual card cannot be controlled by any application.

However, you can use HCE to emulate a 'tag' that can receive information by designing some protocol over ISO 14443-4 APDU. But I do not think it would be elegant to do so.

Got it thanks, I will try this.