-
Notifications
You must be signed in to change notification settings - Fork 134
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
Web NFC support #75
base: master
Are you sure you want to change the base?
Web NFC support #75
Conversation
feel free to test and give some feedback :) |
Any idea if this will be merged? I need to use NFC in a PWA app. |
not sure |
Thanks. Did as you suggested. Next problem I'm facing is that I only need the uid indentifier of the tag. Any help in getting this from the cached message would be appreciated. Thanks |
Are you testing on web or native? Have a look at this file, where I used the WebNFC plugin: Specifically look at function activateNFCScan(). Also make sure to use my fork on branch web-nfc, instead of master. |
I am testing on WEB Did as you suggested but I see that the id field within the records is blank. I assume the return records are only from the user memory pages of the tag. I'm trying to get at the UID (serial number) which is stored in memory page 0h to first byte of 02h. User memory (where the Ndef records are kept is from 04h onwards) On the android version of the package the callBack to the .startSession() function returned an NfcTag object which contained the UID (aka serial) If we are successfully reading the Ndef records it feels like we are close to getting the tag UID |
Ah, I see. Have a look at the example of web-nfc:
So you would have to change the js file of my fork: In function startNDEFReaderJS(), the plugin starts JS Web NFC and reads the NDEF records and translates them into Dart Object. After changing the flutter_nfc.js File, make sure to minify it. The plugin uses flutter_nfc_min.js instead of flutter_nfc.js for performance reasons. In the comment header at the top of the file flutter_nfc.js you can see how to do it. Sorry, due to a setup change I'm currently not able to implement and test it myself. |
This works perfectly. Thank you so much for the help. |
Nice! I'm glad I could help. |
Any possibility to get this merged? Any help needed with testing or fixes to the code? |
implements #72