snapdrop icon indicating copy to clipboard operation
snapdrop copied to clipboard

Implement sharing though native Android share sheet

Open hep-mh opened this issue 2 years ago • 6 comments

This is less of a bug report and more of a feature request. To my limited knowledge, it is actually possible to make a PWA integrate with native share dialogs of e.g. Android and iOS. For example, the Twitter PWA is implementing this functionality. Would we great if this could be implemented in the future!

hep-mh avatar Feb 06 '22 20:02 hep-mh

Until it is implemented, you might want to use the android client. See https://github.com/fm-sys/snapdrop-android

fm-sys avatar Feb 06 '22 21:02 fm-sys

Thanks a lot for the tip, this works great! However, ultimately I would prefer to see this feature implemented in the PWA, especially since Snapdrop is a prime example of what should be implemented as a PWA. However, given the existence of this app, I understand that such an implementation is not a top priority.

hep-mh avatar Feb 07 '22 09:02 hep-mh

Just researched a bit, and PWAs do support share target support, here are some resources about it:

  • https://mconverter.eu/blog/web_share_target_api/
  • https://web.dev/web-share-target/
  • https://web.dev/web-share/

Unfortunately, iOS doesn't seem to support PWAs properly so this won't work for iPhones...

xpire avatar Apr 24 '22 02:04 xpire

@hep-mh Has been implemented since last year, maybe even 2020.

hello-smile6 avatar May 27 '22 02:05 hello-smile6

@hello-smile6 Are you sure? Does not work on any of my three Android devices. Only way to do it is via the dedicated Android app.

hep-mh avatar Jul 06 '22 15:07 hep-mh

At the moment, only text/URL sharing seems to be implemented in Snapdrop. https://github.com/RobinLinus/snapdrop/blob/a96dde25c07478684cf95878c031d7613ceaf9fd/client/manifest.json#L31-L39 https://github.com/RobinLinus/snapdrop/blob/a96dde25c07478684cf95878c031d7613ceaf9fd/client/scripts/ui.js#L501-L518

To be able to share files to Snapdrop through Android share sheet, changes mentioned by @xpire should be implemented (modifying share target in manifest.json and adding a handler to the code). Keep in mind, though, that the spec is currently in the draft stage (and seems to only be implemented by Chrome) and might thus get changed in the future.

zznidar avatar Oct 02 '22 10:10 zznidar