我网站的用户可以通过 Facebook Connect 或 API 邀请他们的朋友吗?

问题描述:

使用 Facebook API 让我流血,但我在这里遇到了一个具体问题,我希望有人能找到解决方案.我正在使用 Facebook PHP SDK 来允许我网站的用户将他们的 FB 帐户与其网站帐户相关联,以便他们稍后返回并单击登录(通过将他们的 OAuth 令牌存储在我的数据库中).这一切正常 - 我现在想要的是能够使用我网站上的表单为用户提供邀请/推荐他们的朋友访问我的网站的功能.

Working with the Facebook API makes my ears bleed, but nonetheless I've got a specific problem here which I'm hoping someone can find a solution for. I'm using the Facebook PHP SDK to allow users of my website to link their FB account with their website account, so they can return later and log in with one click (by storing their OAuth tokens in my database). This is all working fine - what I now want is to be able to provide users with the facility to invite/recommend their friends to my site, using a form on my site.

我从很多地方尝试过 FBML 示例,包括 here - 我已经设法获得了一个邀请表格来显示,但尽我所能,我所能得到的只是对我的应用程序的邀请,这是不相关的.该应用程序的存在只是为了让我有一个 OAuth ID/秘密可以与 Graph API 一起使用.我想邀请用户的朋友访问我的网站,或者至少邀请访问我网站的 Facebook 主页.但似乎在我的页面上包含此 FBML 只会生成应用程序邀请.

I've tried FBML examples from many places including here - I've managed to get an invitation form to display but try as I might, all I can get it to generate is an invitation to my application, which isn't relevant. The app exists only so that I have an OAuth ID/secret to use with the Graph API. I want to invite the user's friends to my website, or at the very least to a Facebook Page plugging my website. But seemingly including this FBML on my page will only generate application invites.

我的问题:有没有办法做到这一点?我可以邀请用户的朋友访问我的网站(即访问特定 URL),或邀请他们访问我的 FB 页面吗?我是从错误的角度接近这个吗?

My question: is there any way to accomplish this? Can I invite the user's friends to my site (ie. to a specific URL), or invite them to my FB Page? Am I approaching this from the wrong angle?

任何建议将不胜感激.如果您从任何进一步的信息中受益,请告诉我.非常感谢,

Any advice would be much appreciated. If you'd benefit from any further info, please let me know. Many thanks,

比格斯

对.事实证明,经过多次撕裂头发后,我举的例子是正确的.邀请会生成应用邀请",但这与其他应用邀请不同.当收件人单击接受"时,他们将被发送到您指定的 URL(在本例中为我的网站).应用程序"然后从他们的请求页面中消失 - 它不会像普通应用程序一样出现在他们的个人资料中.所以这是一个非常荒谬的过程,但却是一个积极的结果.呼!

Right. It turns out after much tearing of hair, the example I gave was the right one. The invite generates an "Application Invite", but this is not like other app invites. When the recipient clicks "Accept" they are sent to the URL you specify (in this case, my website). The "App" then disappears from their request page - it does not appear in their profile like a normal app. So a horribly nonsensical process but a positive outcome. Phew!