Facebook发布在页面墙上 - PHP SDK [英] facebook post on page wall - PHP SDK

查看:127
本文介绍了Facebook发布在页面墙上 - PHP SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个在Facebook页面(作为管理员)发布状态的脚本。
这是我使用的脚本:

I'm trying to create a script that post on a facebook page (as an administrator) a status. This is the script i'm using:

try {
    $access_token = (new FacebookRequest( $session, 'GET', '/' . $pageID,  array( 'fields' => 'access_token' ) ))
        ->execute()->getGraphObject()->asArray();

    $access_token = $access_token['access_token'];

    $page_post = (new FacebookRequest( $session, 'POST', '/'. $pageID .'/feed', array(
        'access_token' => $access_token,
        'message' => $message,
      ) ))->execute()->getGraphObject()->asArray();
} catch (FacebookRequestException $e) {
    echo 'ERROR! ' . __LINE__ . $e->getMessage();   
} catch (Exception $e) {
    echo 'ERROR! ' . __LINE__ . $e->getMessage();
}

该脚本工作,我看到Facebook上的帖子(忽略语言) :

The script does work, and I see the post on facebook (ignore language):

问题是我是唯一可以看到这篇文章的人。当其他用户进入该页面时,他们看不到该帖子,如果我给他们的帖子的网址,它说它不存在。

The problem is that I'm the only one who can see this post. When other users enter the page, they can't see the post, and if I give them the post's url, it says that it doesn't exist.

推荐答案

您需要在应用信息中心的状态和评估标签之前公开您的应用。

You need to make your app public, on top of Status&Review tab in app dashboard.

只要一个应用程序正在开发中模式,只有在Facebook上创建的所有内容才可以在应用管理员/开发人员/测试人员看到。

As long as an app is in development mode, everything it "creates" on Facebook is only visible to app admins/developers/testers.

(这不需要提交您的应用程序进行审核,因为您将只有自己使用它,只有当你想要求其他用户的权限,你需要提交这些审查。)

(This does not require to submit your app for review, since you will only be using it yourself. Only if you wanted to ask other users for permissions as well, you’d need to submit those for review.)

这篇关于Facebook发布在页面墙上 - PHP SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆