chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 559 forks source link

Question: Is is possible to disable Beam (share) #200

Closed tsukasa1989 closed 8 years ago

tsukasa1989 commented 8 years ago

Hello,

Is it possible with the current version to disable NFC Beam? Because for some screens of my application I do not want Android to "zoom" out so the Android Beam takes over.

I know you can do this within Android:

NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this); 
adapter.setNdefPushMessage(null, this, this);

Is there any way to simulate that action? To pass null into the first param.

Thanks

tsukasa1989 commented 8 years ago

nfc.unshare(); already calls this method, so on startup I just call nfc.unshare();

don commented 8 years ago

I think that Android defaults to beaming an AAR record for your app if you don't define one. Calling nfc.unshare() will work. I think there's also a way to disable this in the AndroidManifest.xml too, but I can't find a link right now.