-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFC Share #22
Comments
It sounds like the Arduino part of your code is working fine. Those 2 NFC records you're seeing are the default records that an Android apps shares via beam. Basically it's a link to the Play store. Normally Android will disable this when you're sharing a NFC record from your app. I think you have a problems with the Cordova app. Try using this sample project https://github.com/don/nfc-share to get started with phonegap-nfc and sharing tags. If the default code sends a URI correctly, you can modify the code to send a Text Record Replace https://github.com/don/nfc-share/blob/master/www/js/index.js#L41
with
|
Hello again.
but when textrecord is occured
Thank you. |
Is it possible to get only the payload ? |
Your second example for the text record looks like the default NFC share generated by Android, which likely means that you have an error in your Cordova code. Try running |
To get the payload as a String try something like https://github.com/don/NDEF/blob/master/examples/ReadTagExtended/ReadTagExtended.ino#L70 You'll need to do more work if you have non-ascii characters in your string. |
All is working, thank you very much :) |
Hello don,
I explain my situation :
I have a Yùn board with nfc seeedstudio plug on it.
I have a Sony Xperia SP as mobile.
I load the nfc arduino program called "P2P receive" on the arduino board.
I wrote a cordova app that use this library : https://github.com/chariotsolutions/phonegap-nfc
Then, i share content to the arduino via my app (share, not write)
And i got results.
But i cannot see what i sent from my phone.
I get two NDEF messages, one thet say it came from my phone with the package name and another that link to the play store to my app and it is concatenate with "&beam" or something like that.
(i'm don't have the board right niw with me)
Any help or suggestions ?
I hope i was as clear as possible ^^
Thank you very much in advance.
Edit: I share a textrecord
The text was updated successfully, but these errors were encountered: