简体   繁体   English

Facebook登录,通知用户提要

[英]Facebook login, Notification to users feed

I have incorporated a facebook login using javascript into my forum. 我已经将使用javascript的Facebook登录信息集成到了论坛中。 To add a bit of value, I want when someone signs up to the forum using their facebook account, it will send a notification to the users feed in which their connections will be able to see. 为了增加一点价值,我希望当有人使用其Facebook帐户注册论坛时,它将向用户供稿发送一条通知,让他们可以看到其连接。 For example: 例如:

user3743982 just signed up for Service X. The best X Service about. user3743982刚刚注册了服务X。关于最佳X服务。

Does anybody have any good resources they could share on how to do this? 是否有人可以分享有关如何执行此操作的任何良好资源? I have since this done hundreds of times, but have failed in my hunt for material, tutorials, and know hows. 自那以来,我已经完成了数百次,但是在寻找材料,教程和专有技术方面却失败了。

Thanks in advance 提前致谢

You can do this by calling FB.api method once you get the response object after authentication. 验证后获得响应对象后,可以通过调用FB.api方法来执行此操作。 Note that you need to get publish_actions permission in order to make publishing API calls. 请注意,您需要获得publish_actions权限才能进行发布API调用。 So, your final code must look something like: 因此,您的最终代码必须类似于:

FB.login(function(response) {
   if (response.authResponse) {
     FB.api('/me/feed', 'post', {message: 'I signed up for the service X!'});
     });
   } else {
     console.log('User cancelled login or did not fully authorize.');
   }
 }, {scope: 'publish_actions'});

You can find more information on this in the following documents: 您可以在以下文档中找到关于此的更多信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM