Navigator.share() doesn't work for second time

1.3k views Asked by At

There is an example on MDN with Webshare API: https://mdn.github.io/dom-examples/web-share/

On my iOS device (iPhone 7 / iOS 14.0 / Safari) it works fine only once. For the second time it throws permission error:

Error: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Here are all the steps to reproduce:

  1. Go here
  2. Click "Share MDN!" button
  3. Choose one of suggested options or just close sharing popover
  4. Click on "Share MDN!" button again
  5. See the error

Do you have any suggestions how to fix that? Is it a known bug?

1

There are 1 answers

0
TechnoTim On

I am also experiencing this. This looks like a regression bug in WebKit as seen here:

https://bugs.webkit.org/show_bug.cgi?id=216913

As for when Apple will include this and release it is up to them. I will update this answer when it works.