上传盖通过Facebook的API事件抛出Exception [英] Uploading a cover to an event through the facebook api throws an Exception
问题描述
我以前可以上传封面照片通过使用在这篇文章中所描述的方法HTTP帖子给Facebook事件:<一href=\"http://stackoverflow.com/questions/15725574/facebook-php-sdk-upload-event-cover-photo\">Facebook PHP SDK:上传事件封面照片
I used to be able to upload cover photos to facebook events through http posts using the method described in this post: Facebook PHP SDK: Upload Event Cover Photo
据停止工作日前,将创建事件,但盖子不会上传了,用图形给我尝试以下响应:
It stopped working recently, the event is created but the cover won't upload anymore, with the graph giving the following response at my attempts:
{错误:{类型:异常,消息:该用户没有权限这张照片附加到另一个对象,code:1366035}}
Facebook的文档是稀缺的,当涉及到处理封面图片,我无法找到此特定错误code的任何提及。
The facebook documentation is scarce when it comes to handling cover images and I can't find any mention of this specific error code.
有没有人来这个问题?
推荐答案
我使用user_token添加事件并覆盖到页面有同样的问题。
我的解决方法是让page_token使用user_token,然后用page_token创建事件和覆盖。
I had the same issue using user_token to add event and cover into page. My workaround is to get page_token using that user_token, and then create event and cover using page_token.
$fb->setAccessToken($user_token); //set your user token
$result = $fb->api($page_id.'?fields=access_token', 'get');
if(isset($result["access_token"])) //this will be set if your user has a permission on the page.
{
$page_token = $result["access_token"];
$fb->setAccessToken($page_token);
}
//create event add cover as before
这篇关于上传盖通过Facebook的API事件抛出Exception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!