2014-01-07 19 views
2

我曾经是能够通过使用在这篇文章中描述的方法进行的HTTP帖子上传封面照片至Facebook事件:Facebook PHP SDK: Upload Event Cover Photo通过Facebook的API上传盖事件抛出Exception

它停止最近,工作创建事件,但盖子不会上传了,用图形给我尝试以下回应:

"{"error":{"type":"Exception","message":"The user doesn't have permission to attach this photo to another object.","code":1366035}}"

Facebook的文档是稀缺的,当涉及到处理封面图片,我无法找到任何提及这个特定的错误代码。

以前有没有人来过这个问题?

+0

您能否将封面上传到活动?如果是的话,你可以请示 –

回答

5

我有同样的问题,使用user_token添加事件和封面到页面。 我的解决方法是使用该user_token获取page_token,然后使用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 
+0

好吧,脸书无法给我一个决定性的答案,在这里,你在这里,穿过这件作品穿过我的地牢门。我的英雄。这是我的Stackoverflow批准,好的先生。 – kaore