简体   繁体   English

我如何在Facebook用户墙上发布信息?

[英]How do I post on Facebook User's wall?

I have some Facebook user in my database with their facebook id which is I have got after they login via my facebook app. 我的数据库中有一些Facebook用户,其Facebook ID是他们通过我的Facebook应用登录后获得的。 Now I want to post their wall after a certain period using php. 现在,我想在一段时间后使用php发布他们的墙。

I have got their user id using below code- 我使用以下代码获取了他们的用户ID-

include_once "facebook.php";

$facebook = new Facebook(array(
  'appId'  => xxxxxxxxxxxxxxx,
  'secret' => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
  'cookie' => true,
));

$user       = $facebook->getUser();

if ($user) {
  try {
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    print_r($e);
    $user = null;
  }
}

I have got their id from $user_profile variable. 我从$ user_profile变量中获得了它们的ID。

I am using this scope to login "email,publish_actions" 我正在使用此范围登录“ email,publish_actions”

Please give me some sample code if possible, I'm too much worry about this :( 请给我一些示例代码,如果可能的话,我太担心了:(

Sorry for my poor English 对不起,我英语不好

As of 2nd October 2013 you can no longer post to another user's wall using the API: 自2013年10月2日起,您将无法再使用API​​发布到其他用户的留言墙上:

Removing the ability to post to friends' timelines via API 删除通过API发布到朋友的时间表的功能

We have found that posting content via API (stream.publish) on a friend's wall lead to a high incidence of user dissatisfaction (hiding content, blocking the app). 我们发现,通过API(stream.publish)在朋友的墙上发布内容会导致用户不满(隐藏内容,阻止应用程序)的发生率很高。 After the migration period, posting content to friends' timelines via stream.publish will no longer be allowed. 迁移期过后,将不再允许通过stream.publish将内容发布到朋友的时间表中。 Please use the Feed Dialog for posting. 请使用Feed对话框进行发布。

Source: https://developers.facebook.com/docs/apps/migrations/completed-changes 资料来源: https : //developers.facebook.com/docs/apps/migrations/completed-changes

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

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