2

我有一个网页,我想简单地显示公开可用的 Facebook 页面 ( https://www.facebook.com/jaycorvs ) 的最新状态。

我制作了一个应用程序,获得了 API 密钥和密钥等...使用 PHP SDK 我遇到了以下问题:

// Facebook
require_once('facebook-php-sdk/facebook.php');

$facebook = new Facebook(array(
    'appId' => '5799359587XXXXX',
    'secret' => 'd466917a5XXXXXXXXXXXXX9dff4d77a79',
));

$status = $facebook->api("/jaycorvs/statuses?access_token=".$facebook->getAccessToken() );

// Error:
Fatal error: Uncaught OAuthException: (#100) Requires user session thrown in /vhosts/asdfasdfa.com/public/facebook-php-sdk/base_facebook.php on line 1264

那么,这是否意味着,为了在网页上显示一个简单的、公开可用的状态更新,我实际上必须让访问者通过 Facebook 应用程序许可流程(“此页面想要访问您的朋友、提要等”) ???

我正在查看我一年前做的一个旧项目,当时情况并非如此,因为该项目的代码非常相似。Facebook最近改变了这一点吗?

另外,我为什么可以访问页面的完整提要(http://facebook.com/jaycorvs/feed),而不仅仅是通过此应用程序权限访问的雕像本身?这根本没有意义。

我在这里遗漏了一些明显的东西吗?或者 Facebook 是否真的需要这些类型的应用权限才能简单地查看公共状态?

4

2 回答 2

2

似乎这是一个错误,已在 2013 年 2 月报告:

https://developers.facebook.com/bugs/480742545315442

但是他们已经给予了这个低优先级,并且到目前为止还没有给出任何更新。

于 2013-10-18T22:55:34.810 回答
0

I also have another bug out regarding it, but in the meantime, there's a few ways around it:

First, parse the /feed, as you probably know, it's one way to get the data you want... I used to do this... but as the size of my data collections grew it became too process intensive...

The other option? Use /posts.

/posts... i think is analogous to /statuses, the main difference is in the format of the ID... ID in the /posts query is usually the pagename_nodeid

like 19292868552_10150189643478553... you could splice that and reconstitute it to get posts...

if you search 10150189643478553 (hypothetically), you'll get the

{
  "error": {
      "message": "(#100) Requires user session", 
      "type": "OAuthException", 
      "code": 100
  }
}

but, adding the pageid as the prefix to the node id allows you to bypass the user session issue...

于 2013-10-30T22:39:26.363 回答