通过facebook sharer.php或使用FB.api在Facebook上共享自定义消息,链接和图像 [英] Share custom message, link and image on facebook via facebook sharer.php or using FB.api

查看:122
本文介绍了通过facebook sharer.php或使用FB.api在Facebook上共享自定义消息,链接和图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现Facebook共享.我尝试使用facebook sharer.php,但它不再接受自定义参数(facebook不推荐使用).另外,我看到了使用FB.api在Facebook上发帖的选项.

I want to implement facebook sharing. I tried using the facebook sharer.php but it no more accepts custom parameters (deprecated by facebook). Also, I saw an option to use the FB.api to post on facebook.

我只是想知道使用FB.api进行此操作的正确语法,我可以在其中共享一些自定义消息,图像和链接. P.S. -我正在使用的应用程序是基于Java的,页面是jsp页面.

I just want to know the correct syntax for doing this using FB.api where I can share some custom message, image and link. P.S. - The application that I am working on is Java based and pages are jsp pages.

谢谢.

推荐答案

消息必须是100%用户生成的,因此不允许预填充-如果这是自定义消息"的意思.就是说,这里有FB.ui共享对话框: https://developers. facebook.com/docs/sharing/reference/share-dialog

Messages must be 100% user generated, prefilling is not allowed - if that is what you mean with "custom message". That being said, there is the FB.ui share dialog: https://developers.facebook.com/docs/sharing/reference/share-dialog

它的工作方式类似于sharer.php,仅将URL作为参数.这是推荐的方法,您只需要添加正确的打开图表标签共享网址.

It works similar to sharer.php and only takes the URL as parameter. That´s the recommended way, you just need to add the correct Open Graph tags to the shared URL.

共享内容的另一种可能方法是使用用户对象的feed终结点:

Another possible way to share something is to use the feed endpoint of the user object: https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed#publish

...但您需要为此授予用户publish_actions的权限,并且必须先在Facebook上进行审核,然后才能获得该权限的公开.显然,如果您预先填充message参数,您将不会获得批准.

...but you need to authorize the user with publish_actions for that, and you have to go through a review process on Facebook before you can go public with that permission. Obviously, you will not get approved if you prefill the message parameter.

有关一般共享的更多信息: https://developers.facebook.com/docs/sharing

More information about sharing in general: https://developers.facebook.com/docs/sharing

这篇关于通过facebook sharer.php或使用FB.api在Facebook上共享自定义消息,链接和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆