Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open the native iOS share modal from a link on a webpage?

I have a share button on my webpage. I want tapping the button in mobile Safari to open the iOS native share modal.

How do I achieve this with HTML/Javascript?

I can see that the Wall Street Journal have been able to achieve this with the share buttons on their website. I have not been able to find any answers on Stack Overflow or Google.

like image 234
gcg1 Avatar asked Sep 15 '25 00:09

gcg1


1 Answers

You could try

navigator.share({
 title: 'Your title',
 text: 'Your text',
 url: 'Your url to share'
})

on click on your link.

like image 185
pierre Avatar answered Sep 17 '25 15:09

pierre