通过facebook api将封面上传到事件会引发异常 [英] Uploading a cover to an event through the facebook api throws an Exception
问题描述
我以前可以使用这篇文章中描述的方法通过http帖子将封面照片上传到Facebook事件: 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:
{error:{type:Exception message:用户没有权限将此照片附加到另一个对象,code:1366035}}
在处理封面图片时,facebook文档很少,我找不到任何提到这个特定的错误代码。
The facebook documentation is scarce when it comes to handling cover images and I can't find any mention of this specific error code.
有没有人在这个问题之前?
Has anyone come by this issue before?
推荐答案
我使用user_token将事件和封面添加到页面中也有同样的问题。
我的解决方法是使用该user_token获取page_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将封面上传到事件会引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!