Closed frol closed 4 years ago
Not at the moment, because Safari on iOS doesn't support WebRTC data channels. The new Safari in iOS 11 does support some parts of WebRTC, but AFAIK it still doesn't support data channels. However, there was a very similar project (can't remember its name though :/), which used websockets and an intermediary server in such cases. It wasn't P2P then though, but still worked pretty well.
I have iOS 11 on my iPhone and neither Safari nor Google Chrome can send or receive files, though the device is discoverable. That is unfortunate... ShareDrop is an awesome project! Thank you!
I haven't tried iOS 11 yet, but it looks like at least discovery works fine ;) Hopefully, they'll add data channels support in the future as well and everything will "just work". Cheers!
Well, I went ahead and extracted the console logs from iOS 11 (using MIHTool):
Nothing happens after that, neither errors, nor any further progress.
Also, I checked other WebRTC services and discovered that https://webtorrent.io/ (to be more accurate, https://instant.io/) supposedly uses WebRTC with data channels and it works fine on my iOS devices.
@frol Thanks for checking it out! ShareDrop at the moment uses a pretty old library (PeerJS) for handling WebRTC related stuff (it worked so far, so there was no reason to change it) and I wanted to switch to simple-peer
(which is used by WebTorrent) or even WebTorrent itself ;) I know that at least at the beginning, Safari on iOS 11 did not support data channels. If more recent versions do actually support it, then it's really awesome and I will try to update ShareDrop as soon as I get my hands on a new iPhone (I still got iPhone 5) and iOS 11. Maybe it can even work in Edge ;)
I can help you with debugging if you wish. I only need some guidance (I am familiar with JS ES6).
Thanks! I haven't really touched this code much since ages, so I'd have to clean it up a bit and switch to simple-peer
, which is actively maintained and hopefully might just fix these issues. I'll get back to you if I have any updates.
FYI, snapdrop can send and receive files on iOS 12 (I cannot check on iOS 11), though receive process fails to save the received blob.
Hey guys, any update on the above? We're trying to use Snapdrop for sending a small video to an iPhone, so curious if you guys have resolved the issue.
It looks like both desktop and mobile Safari do finally support WebRTC data channels that are required by ShareDrop to work. There are 2 issues though:
in some cases it implements only newer version of some WebRTC API calls, so the older ones used by ShareDrop fail. This can be updated relatively easily.
to identify peers, ShareDrop tries to get device private (local) IP. Because of security reasons, Safari only allows a page to get device private IP, if a user grants this page access to the mic and camera :/ This is a bigger issue and I need to check if ShareDrop can work without user's private IP, or add a mechanism that asks users to grant this access, if you're using Safari.
Small update - desktop Safari is now supported! iOS is still not though, because it seems I'd have to ask for mic and camera access to be able to transfer files using p2p (SnapDrop uses websockets as a fallback, that's why it works there) and it's going to be rather hard to explain to users that I need this access just to transfer a file :/ I did some tests and if I do ask for it and grant it, it work fine though.
However, receiving files on iOS is also a bit awkward, as it tries to open the received file in the same tab as the running app, instead of showing some kind of download dialog :/ I guess it's the same issue as mentioned above: https://github.com/RobinLinus/snapdrop/issues/59.
BTW. Snapdrop looks really cool ;)
I'm closing this issue, because, surprisingly, it now works in iOS as well.
Is it possible to implement ShareDrop for iOS (iPhone / iPad)? I would love to use ShareDrop exclusively for all the devices...