【问题标题】:what all permission i need to publish on facebook?我需要在 Facebook 上发布什么许可?
【发布时间】:2013-08-02 07:30:33
【问题描述】:

我正在尝试通过我的网站在 facebook 上发布帖子。

我有这些权限

'scope' => 'read_stream, email, publish_stream, user_birthday, user_location, user_work_history, user_hometown, user_photos',

但我无法发布帖子。示例如下,我无法发布。

if(isset($_POST['publish'])){
    try{
        $statusUpdate = $facebook->api("/$user/feed", 'post', array(
            'message'       => 'Message here',
            'link'          => 'webiste link here',
            'picture'       => 'image link here',
            'name'          => 'Heading',
            'caption'       => 'example.com',
            'description'   => 'bla bla bla bla',
            ));
    }catch(FacebookApiException $e){
        error_log($e);
    }
}

但是我可以成功地发布简单的帖子(状态),只需要消息

if(isset($_POST['status'])){
    try{
        $statusUpdate = $facebook->api("/$user/feed", 'post', array('message'=> $_POST['status']));
    }catch(FacebookApiException $e){
        error_log($e);
    }
}

谁能告诉我我需要什么额外的许可或我缺少什么?

使用 Graph API 我收到此错误

{
  "error": {
    "message": "(#100) The post's links must direct to the application's connect or canvas URL.", 
    "type": "OAuthException", 
    "code": 100
  }
}

在我的error_log.php 我发现了这个

OAuthException: (#100) 帖子的链接必须指向应用程序的连接或画布 URL。

【问题讨论】:

  • 捕获的错误是什么?
  • 当我使用图形 api 尝试时,我在上面的问题中添加了错误
  • 尝试在应用设置中将“Stream Post Url Security”设置为false
  • 哇,你可以添加你的答案,我会投票赞成它:)

标签: facebook facebook-graph-api


【解决方案1】:

要解决错误:(#100) The post's links must direct to the application's connect or canvas URL.,您必须在应用设置中将“Stream Post Url Security”设置为 false

旁注:您不需要user_birthday 和其他人来发布提要。只需要publish_stream

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-19
    • 1970-01-01
    • 2016-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-01
    相关资源
    最近更新 更多