When passed a data object with both text, and image parameters, navigator.share() produces: "Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission." This occurs even if navigator.canShare returns true when passed the same data object. This prevents users from sharing image, text and urls at once and negatively impacts iOS users' abilities to share content on the web. Not a duplicate, but could be related to: https://bugs.webkit.org/show_bug.cgi?id=231995 For now the Web Share 2 API remains broken on iOS. Produced on iPhone X iOS 15.5 (19F77)
I'll try to reproduce, but there are a few things that can cause canShare() to return true, but still result in a NotAllowedError: 1. .share() called multiple times before the first call's promise settles. 2. .share() is not initiated by user activation (or, more unlikely, there is no Window object). 3. Permissions policy violation, but this produces a different error string so we can rule this out.
Ok, confirmed. This is indeed being caused by 231995 and it's a result of 1 (because even though shares completes, the promise is not being resolved). Thus, subsequent calls to .share() cause the API to freeze. *** This bug has been marked as a duplicate of bug 231995 ***