admin管理员组文章数量:1336367
I'm currently using Navigator.share()
to invoke the native share API
. Everything is fine and dandy except what I'm sharing is a link to an image
.
On iOS
, there is a preview image
that shows up when using Safari's share icon
and I can't figure out how to get that to show up for Navigator.share()
as well.
Navigator.share()
Here is an example of the same page being shared using Safari's browse share tool
.
Safari's browser share tool
I'm currently using Navigator.share()
to invoke the native share API
. Everything is fine and dandy except what I'm sharing is a link to an image
.
On iOS
, there is a preview image
that shows up when using Safari's share icon
and I can't figure out how to get that to show up for Navigator.share()
as well.
Navigator.share()
Here is an example of the same page being shared using Safari's browse share tool
.
Safari's browser share tool
Share Improve this question edited Jun 13, 2020 at 0:07 Sowjanya R Bhat 1,16810 silver badges21 bronze badges asked Jun 12, 2020 at 19:12 Tommy PhamTommy Pham 911 silver badge7 bronze badges1 Answer
Reset to default 7I believe I came across a solution.
The data Navigator.share()
is expecting can contain the properties: title
, text
, url
, and files
. I only use title
, text
, and url
. I decided to omit title
and text
and it worked! I'm guessing it's because when they are set, the API doesn't use the meta information provided by the page to produce the preview image.
本文标签: javascriptHow to add a preview image to Navigatorshare()Stack Overflow
版权声明:本文标题:javascript - How to add a preview image to Navigator.share() - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742374406a2462870.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论