Bug 198606 - Implement the Web Share API Level 2
Summary: Implement the Web Share API Level 2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 207491 209265
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-06 04:41 PDT by Thomas Steiner
Modified: 2020-09-24 01:25 PDT (History)
14 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Steiner 2019-06-06 04:41:03 PDT
WebKit supports "Web Share — Level 1" since https://bugs.webkit.org/show_bug.cgi?id=171100 was resolved (🙏 thanks!).

"Web Share — Level 2" adds a feature detection method `canShare()`, and the `ShareData` dictionary now has a `files` member for sharing files (https://wicg.github.io/web-share/level-2/#changes-since-level-1).

This allows use cases like sharing images apart from text.
Comment 1 Gabriele Nosso 2020-04-03 04:24:36 PDT
Hi everyone,
I am Gabriele, Software Architect for X-Rite Pantone (www.pantone.com, www.xrite.com).

We have hundreds of thousands per user on our website per month, so we are expecting a high number of users also in our new apps.

We will soon release a mobile App for Pantone  for both iOS and Android, which will provide a sharing palettes/pictures features.

It would be amazing to have the Web Share Api level 2 implemented, so we could make the feature available also on iOS.

Is there any ETA for this task?

Thanks.
Comment 2 Samy Dindane 2020-04-09 08:13:20 PDT
Hello,

My name is Samy and I am the founder of Hypefury. We help online entrepreneurs grow their audience and market their products.

We already implemented features such as sharing pictures on Instagram, and they work perfectly on Android.

Most our users use iPhones though, and supporting level 2 sharing would make their experience a whole.

Thank you,

Samy
Comment 3 Thomas Steiner 2020-05-06 01:21:10 PDT
Fixed via https://bugs.webkit.org/show_bug.cgi?id=207491.
Comment 4 Maciej Stachowiak 2020-05-07 02:16:40 PDT
Looks like this hasn't fully landed yet, so reopening and adding relevant dependencies.
Comment 5 Maciej Stachowiak 2020-05-10 18:50:24 PDT
All subtasks are complete, but this isn't enabled by default yet.
Comment 6 Erik Murphy-Chutorian 2020-05-20 10:15:57 PDT
I'm thrilled to see the progress on this bug. Media sharing for 'image/jpeg' and 'video/mp4' files has been a top requested feature for our web platform from numerous big brands and creative agencies.

Any chance this will be enabled by default in iOS 13.6+?
Comment 7 Matt Oakes 2020-05-28 07:20:12 PDT
Just to note that while the "canShare" method was implemented and accepted, support for the "files" property is still not implemented.
Comment 8 Erik Murphy-Chutorian 2020-05-28 08:07:20 PDT
@Matt, even with the following resolved dependent bug "Implement web-share v2 for files"? https://bugs.webkit.org/show_bug.cgi?id=209265
Comment 9 jcesarmobile 2020-07-06 10:01:54 PDT
Seems to be implemented on iOS 14 (first beta) including WKWebView, but with a few problems.

I tested with this website https://w3c.github.io/web-share/demos/share-files.html

The title is not used, the message is shown instead.

Sharing to AirDrop sometimes show an error or don't properly share some of the items.
Sharing to twitter doesn't show the selected images and don't let you share (probably because of that)
Sharing to messages or mail doesn't attach the images.


Other than that, it looks like a good starting point for iOS 14 before it's final.
Comment 10 jcesarmobile 2020-07-06 10:08:09 PDT
Note that "Web Share API Level 2" is still disabled as default in the experimental section of Safari settings, but it's working fine without enabling it. Not sure if it could stop working in future beta releases or if it means that it is no longer experimental.
Comment 11 rigel 2020-09-17 10:21:13 PDT
This API works well but is turned off by default in iOS 14. Please either turn it on by default or promote it out of experimental features as many of our customers rely on this functionality. Thank you.
Comment 12 Erik Murphy-Chutorian 2020-09-17 10:40:01 PDT
WebShare V2 was working really well in all of the iOS14 betas for file sharing, and we were looking forward to see this launch (default-enabled) in iOS14. This was the most exciting thing about iOS 14 for my company. It is such critical functionality for web developers to be able to share mp4 video files and jpgs to native applications, and Safari is really the only remaining majority browser lacking this ability.


Needless to say, is was discouraging to see it switch off with the public release after building websites in anticipation that would have worked well had the public release matched the betas. Please re-enable WebShare V2 file sharing as a default for Safari users!
Comment 13 Blake Bullis 2020-09-22 07:45:49 PDT
Sad here as well to find L2 is disabled by default in the latest iOS update. Please enable by default, we live in a world of sharing media and this feature will allow developers to enrich the user experience for all Apple users.
Comment 14 Marcos Caceres 2020-09-23 20:09:19 PDT
Note that "Level 2" is no longer a thing: The the "L2" stuff has is being merged into the core spec, and "L2" just redirects to the main spec. 

Note also that Mozilla folks found significant issues with .canShare():
https://github.com/w3c/web-share/issues/108#issuecomment-697689527

This issue can probably be closed as invalid.
Comment 15 Marcos Caceres 2020-09-23 23:15:31 PDT
Just want to clarify that I think the "level 2" support aspect of this bug is invalid (because there is no level 2 spec anymore). However, other bugs that arise from sharing files and .canShare() should be addressed separately.
Comment 16 Thomas Steiner 2020-09-24 01:25:16 PDT
Updated core spec link: https://w3c.github.io/web-share/#api-definition.

This is implemented behind a flag in Safari 14 (using the "Level 2" name suffix), so the status of this bug is probably "Resolved".

Other questions like the fate of `canShare()` indeed deserve new bugs once the spec issues have been closed.