0

我正在使用 facebook PHP SDK 3.1.1,一个 iFrame 应用程序可以发布在已经是该页面粉丝的登录用户墙上。

以下是 coe,它给了我错误“致命错误:未捕获的 OAuthException:(#200) 用户尚未授权应用程序执行抛出的此操作”

/*post starts*/
$attachment = array('message' => 'test message',
'name' => 'test app!',
'caption' => "Caption of the Post",
'link' => 'http://apps.facebook.com/phpsdk_demoapp/',
'description' => 'It is fun!',
'picture' => 'http://www.takwing.idv.hk/facebook/demoapp_phpsdk/img/logo.gif',
'actions' => array(array('name' => 'Start Learning', 
'link' => 'http://www.takwing.idv.hk/tech/fb_dev/index.php'))
);

$result = $facebook->api('/me/feed/',
'post',
$attachment);
/*post ends*/

我想必须将需要用户许可才能在他的墙上发布的部分添加到其中,请帮助。谢谢

4

2 回答 2

0

您必须获得 publish_stream 权限:http: //developers.facebook.com/docs/guides/policy/examples_and_explanations/Extended_Permissions/

于 2011-08-26T18:03:04.113 回答
0

在用户访问您的应用之前,您必须获得用户许可才能墙帖。这可以通过

http://www.facebook.com/dialog/oauth?client_id=" . <your app id> . "&redirect_uri=" . <app redirect url> . "&scope=publish_stream,offline_access'

这将使您可以访问用户墙上的帖子。

于 2012-04-26T06:09:25.043 回答