PWA Webshare iOS 12.3

Hi Guys,

Trying to implement Webshare in PWA App, however it does not seem to work. iOS 12.2 implemented the feature.

I found this article.

Which also has a demo web page to test feature. Test page works on iPAD iOS 12.3

The simple command is navigator.share({title, text, url}) nothing happens

Any ideas?


Just tried it here and it worked fine:


Button1.onclick = function() {
  args = {};
  args.title = "The Title";
  args.text = "The message";
  args.url = "";


Function Button1_onclick()
  args = {}
  args.title = "The Title"
  args.text = "The message"
  args.url = ""
End Function

1 Like

Thank you, however running my app through the Web Inspector of MAC OS connecting my IPAD, I get this error.

[Error] 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.
(anonymous function)

any ideas


Do you get the same message running my app?

Yes it does.

I have found the error. You cannot run it within a function - outside the scope of an onclick event.


function iosWebShare() {
 args = {};
  args.title = "The Title";
  args.text = "The message";
  args.url = "";

call this function outside an click event say from another function.

You get the error.

Hope that makes sense.


@ianResearch you’re saying that if you call the defined function iosWebShare() outside of an event handler, that you get a permission error?

Thats correct.

Seems odd.

When are you calling iosWebShare? Could it be before all the loading is done?

If you take a look at the demo you cited in your original message, the indirect call is done after a delay.

Calling in a menu option selection.

But I am going to do more testing, I can get it to work if i include a button and code in the button onclick all fine but if i call a function containing the code from the menu selection does not work.

I will get back to you once I have done some more checking.

Thank you


Here’s another good document:

It notes:
To use the Web Share API:

  • you must be served over HTTPS
  • you can only invoke the API in response to a user action, such as a click (e.g., you can’t call navigator.share as part of the page load)