简体   繁体   English

使用facebook php sdk获取其他用户提要

[英]get other user feed using facebook php sdk

I am trying to get other users feed in PHP using Facebook Graph API PHP sdk, but with no success. 我试图让其他用户使用Facebook Graph API PHP sdk输入PHP,但没有成功。

i got my feed properly using 我使用正确的饲料

 $request = new FacebookRequest(
  $session,
  'GET',
  '/me/feed'
);
$response = $request->execute();
$graphObject = $response->getGraphObject(); 

But i trying to get other user feed like 但是我试图获得其他用户供稿

$request = new FacebookRequest(
  $session,
  'GET',
  '/534551234549753/feed'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();

is return me this blank response 返回我这个空白的答复

Facebook\GraphObject Object
(
    [backingData:protected] => Array
        (
        )

)

is there any way to get other user's feed ? 有没有办法获取其他用户的供稿?

You can only read the feed of a user if he authorized your App. 只有用户授权了您的应用,您才能阅读供稿。 And you can only get his feed with his very own User Access Token. 而且,您只能使用他自己的用户访问令牌获得他的供稿。

Since you will not get read_stream approved at all, i suggest using the new user_posts permission: https://developers.facebook.com/docs/apps/changelog#v2_3 由于您根本不会获得read_stream批准,因此我建议使用新的user_posts权限: https : //developers.facebook.com/docs/apps/changelog#v2_3

But again: You can ONLY get the feed of the authorized user, not from anyone else. 但是再说一遍:您只能从授权用户那里获取提要,而不能从其他任何人那里获取。 That would be a major privacy issue. 那将是一个主要的隐私问题。

A look in the Facebook docs might have saved you the time for writing your question: 在Facebook文档中查看外观可能为您节省了编写问题的时间:

You can read other user's feeds if you have an app which requests the appropriate permissions during OAuth login: 如果您有一个在OAuth登录期间要求适当权限的应用,则可以阅读其他用户的供稿:

Permissions 权限

Any valid access token is required to view public links. 查看公共链接需要任何有效的访问令牌。 If the app has been granted the read_stream or user_posts permission the app can read: 如果已授予该应用程序read_streamuser_posts权限,则该应用程序可以读取:

  • The user's posts on their own Timeline. 用户在自己的时间轴上的信息。
  • The posts others have made on the user's Timeline. 其他人在用户的时间轴上发布的帖子。
  • The posts others have tagged the user in. 其他人标记了用户的帖子。

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

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