-
Notifications
You must be signed in to change notification settings - Fork 68
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
Unable to transfer data between peer-devices #139
Comments
What browser did you use to test this? I assume Google Chrome? I tried the same and it raises a
That would indicate to me that pushing to peer targets is not supported / implemented by Google Chrome at the moment. |
I can confirm that it is not implemented, mostly due to it requiring Android native UI elements at a platform level. |
@MartinBeekhuizen If you need a workaround to transfer data between peer devices from the browser, you could leverage the Web Share API, to pass the data over Android Beam. Depending on the data you are trying to send, this might not be a solution for you; in my case this worked perfectly since i tried to send an URI, which should be opened in the target's Browser. |
Is there an estimate when peer-to-peer URL transmission by WebNFC will be implemented in Chrome on Android? I'm not having success on Version 66 with navigator.nfc.push({records: [{recordType: 'url', data: url}]}); The suggested use of the Web Share API doesn't work for arbitrary URLs, only for the URL of the page itself. Would it help to add a comment to the Chromium Bug that states that peer-to-peer is not yet implemented? |
@mrj Chromium bug that you mentioned is about whole WebNFC feature and UA developers can decide not to support P2P if needed. You could add comment to the bug that P2P feature is desirable. Also, you can check design document for the feature, I've implemented P2P support, however, it was decided to postpone it. |
Thank you Alex. I've read your linked document, patch, and about Android Intents. I still don't understand why code is needed to support P2P. If WebNFC can currently write a URL to a passive tag, and a passive tag with a URL can currently trigger a browser selector or direct navigation on Android, what is Android Chrome WebNFC sending differently to a passive tag such that the receiving Android device doesn't respond? Is a lot of coding involved? Was the postponement due to the amount of work to polish and release, an assessment of the demand for and the utility of this feature, or corporate strategy? |
@mrj Android Beam™ is used to exchange messages (opened tab url) between active devices, in my patch, I had to modify codepath in a way that will override Chrome's default behavior if WebNFC message is pushed / watched for 'peer' or 'any' target (some might consider it as an API / UX break). Anyways, if you have proposals, concerns or feature requests related to Chromium, please file an issue or add comment in Chromium bug tracker. WebNFC github issue tracker is not an optimal place to discuss UA specific implementation details. |
SNEP (peer to peer protocol is deprecated on Android and not supported on Apple OS'es). For this reason we cannot support this feature. The TNEP and HCE provides a kind of replacement |
Hello,
I did some experiments with the web-nfc API and I'm curious about why the peer-to-peer examples does not work.
The API works fine when pushing and reading messages to and from passive NFC tags.
However when trying to push and read a message from a peer to peer device it does not work.
I tried setting the nfc push options to 'peer' and 'any' and provided a 'timeout' but without success.
So after waiting for the x milliseconds provided the timeout error kicks in.
It looks like the devices are unable to find each other.
The devices are able to transfer data to each other when using the android beaming service.
Is this behavior when reading and pushing data between peer devices known?
Any guidance on how to push/read data to/from peer devices would be appreciated.
The text was updated successfully, but these errors were encountered: