PHP Facebook 在应用程序照片中标记用户
我正在尝试在应用程序创建的照片中标记我的 facebook 应用程序用户。但它给了我错误。
$args = array(
'message' => $fbme['name'].' will have a love marriage.',
'image' => '@' . realpath('./images/wall-e-and-eva1.jpg'),
'tags' => array(
array(
'tag_uid'=> $uid,
'x' => 0,
'y' => 0,
)
)
);
$data = $facebook->api('/'.$uid.'/photos', 'post', $args);
我收到
$uid =$facebook->getUser();
以下错误。我不明白照片是如何创建并上传到用户个人资料的,但用户名没有标记到它。
错误:- 致命错误:未捕获 OAuthException:(#121) 第 543 行 /home/a2611469/public_html/myweb/src/facebook.php 中抛出无效照片 ID
提前致谢
I am trying to tag my facebook-app user in the photo created by the app. but its giving me error.
$args = array(
'message' => $fbme['name'].' will have a love marriage.',
'image' => '@' . realpath('./images/wall-e-and-eva1.jpg'),
'tags' => array(
array(
'tag_uid'=> $uid,
'x' => 0,
'y' => 0,
)
)
);
$data = $facebook->api('/'.$uid.'/photos', 'post', $args);
where
$uid =$facebook->getUser();
I am getting the below error. I dont understand how the photo is created and uploaded to user profile but user name is not tagged to it.
ERROR:- Fatal error: Uncaught OAuthException: (#121) Invalid photo id thrown in /home/a2611469/public_html/myweb/src/facebook.php on line 543
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该将照片标签发布到“/$photo_id/tags/$user_id”,而不是/$uid/photos,这是你这样做的方式。上传实际照片后,您可能必须为每个标签执行一个单独的 API 请求。
请参阅http://developers.facebook.com/docs/reference/api/photo/< /a>
I think you're supposed to POST photo tags to "/$photo_id/tags/$user_id", not to /$uid/photos which is the way you do it. You might have to do one separate API request for each tag, after uploading the actual photo.
See http://developers.facebook.com/docs/reference/api/photo/