通过PHP SDK以用户身份发布到Facebook粉丝专页 [英] Posting to Facebook fan page feed as user through PHP SDK

查看:182
本文介绍了通过PHP SDK以用户身份发布到Facebook粉丝专页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前面临的问题是Facebook API在2012年夏天没有发生。
在我的一个Facebook应用程序中,用户可以将一些文本输入一个textarea,然后将其发布到一个Facebook的粉丝页面,就像他在Facebook上自己浏览的页面一样,并发布在那里。



因此,我的应用程序需要 publish_stream 扩展权限,以便能够发布到页面Feed。



要解决帖子本身,我正在执行以下操作:

  try {
$ response_object = $ fb-> api('XXX / feed','POST',array(
'消息'=> $ input-> post('user_text'),
));
}
catch(异常$ e){
die($ e-> getMessage());
}

去年这个工作没有任何问题。在页面的Feed中(PageId替换为上面的代码片段中的XXX),使用该应用的用户在页面上显示了一条帖子。



令我惊讶的是,当我今天试图做同样的事情时,上面的代码片段被引用了。我没有改变任何我使用fb API处理数据的方式。



我得到的消息如下:

 (#283)需要扩展许可:manage_pages 

我不需要作为页面管理员而是以用户身份发布到墙上。当使用publish_stream权限进行授权时,我检索到用户访问令牌,并且我不想拥有 manage_pages 权限,因为我不需要管理用户页面。 / p>

我想做的只是作为使用该应用程序的用户发布到粉丝页面。



Facebook最近是否在补货后程序中更改了任何内容?或者我个人错过了什么?



提前感谢
Thomas

解决方案

这可以与问题联系起来,它禁止作为给定页面的管理员的用户在该页面的Feed上发布(用户不是页面)。



如果您尝试以平均用户(不是作为页面管理员)发布,请检查是否同样如此。从我的经验,平均如果应用程序有权限,用户可以执行此操作:publish_stream,publish_action。



这是我的错误报告: https://developers.facebook.com/bugs/167764356741336?browse=external_tasks_search_results_51f780dd6e9da2d82532422


I'm currently facing a problem with the Facebook API that did not occur in summer 2012. In a facebook app of mine, the user is able to type in some text into a textarea which is then posted to a facebook fanpage, just as he went to the page on facebook himself and posted it there.

Therefore my app requires the publish_stream extended permissions in order to be able to post onto the pages feed.

To settle the post itself I was doing the following:

try{
    $response_object = $fb->api('XXX/feed', 'POST', array(
        'message' => $input->post('user_text'),
    ));     
}
catch(Exception $e){
    die($e->getMessage());
}

Last year this was working without any problems. On the Page's feed (PageId replaced with XXX in code snippet above) there a post appeared on the page by the user that used the app.

To my surprise the exception in the snippet above was cought when I tried to do the same today. I didn't change anything the way I process data with the fb API.

The message I got was the following:

(#283) Requires extended permission: manage_pages

I don't need to post to the wall as the page administrator but as the user. I retrieved the users access token when authorizing with the publish_stream permissions and I don't want to have the manage_pages permission since I just don't need to manage the users page.

What I want to do is simply post to a fan page as the user that is using the app.

Did facebook change anything lately on the "post-to-feed procedure" or did I personally miss something?

Thanks in advance Thomas

解决方案

This can be linked with issue, which prohibits users who are administrator of the given page, to post on that pages' feed (as user not as page).

Check if the same happens if you are trying to post as average user (not as administrator of page). From my experience, avg. user can do that if application has permissions: publish_stream, publish_action.

Here is my bug report: https://developers.facebook.com/bugs/167764356741336?browse=external_tasks_search_results_51f780dd6e9da2d82532422

这篇关于通过PHP SDK以用户身份发布到Facebook粉丝专页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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