为移动网站添加共享按钮
我想为我的移动网站添加共享按钮,并且需要自定义共享属性。
有没有办法可以共享带有自定义标题、描述或评论的链接?
如果用户通过 Facebook 移动应用程序连接,是否可以通过 Facebook 移动应用程序共享它?
我尝试过使用
<a title="send to Facebook" href="http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE&
p[summary]=YOUR_SUMMARY&p[url]=YOUR_URL&p[images][0]=YOUR_IMAGE_TO_SHARE_OBJECT"
target="_blank"><span><img width="14" height="14" src="'icons/fb.gif" alt="Facebook" />
Facebook></a>
它确实可以与常规网站一起使用,但是当尝试在我的手机中运行它时,它不共享相同的...
I want to add a share button for my mobile site, and I need the sharing properties to be custom.
Is there a way I can share a link with custom title, description or comments?
Is there a way to share it through the Facebook mobile application if the user is connected through it?
I've tried to use
<a title="send to Facebook" href="http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE&
p[summary]=YOUR_SUMMARY&p[url]=YOUR_URL&p[images][0]=YOUR_IMAGE_TO_SHARE_OBJECT"
target="_blank"><span><img width="14" height="14" src="'icons/fb.gif" alt="Facebook" />
Facebook></a>
It does work with regular sites, but when trying to run it in my mobile, it doesn't share the same...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一个解决方法 - 让 Facebook 共享 URL 转到一个重定向到您遇到问题的页面的页面。重定向页面可以包含新的标题、元描述和其他元标记,您可以自定义这些标记,以使 Facebook 共享看起来像您想要的那样。例如,此页面上的二维码会将您的手机带到我使用此技术设计的 Facebook 共享链接。我还通过单击明信片制作了桌面共享链接:http://modernmancaves.com/share.html。旁注:此示例页面不会重定向(以便您有时间尝试二维码、移动共享链接并查看页面的源代码)
I have a workaround for this - Make the Facebook share URL go to a page that redirects to the page that you are having trouble with. The redirect page can have new title, meta description and other meta tags in it that you can customize to make the Fb share look just the way you want it. As an example, the QR code on this page takes your phone to the Facebook share link I designed using this technique. I also made a share link for desktops by clicking on the postcard: http://modernmancaves.com/share.html. Side note: This example page does not redirect (so that you have time to try the QR code, mobile share link and view the page's source code)
您可以在移动设备上触发提要对话框(请参阅 https://developers.facebook.com /docs/reference/dialogs/feed/ )
这允许您指定共享元数据,并且应该自动在移动设备上显示适合移动设备的版本
You can trigger the feed dialog on mobile devices (see https://developers.facebook.com/docs/reference/dialogs/feed/ )
This allows you to specify the share metadata, and should automatically display a mobile-friendly version on mobile devices