开发者

Facebook SDK - Tagging photo error #121

开发者 https://www.devze.com 2023-03-13 22:42 出处:网络
I am trying to upload a photo to开发者_如何学C a user\'s Facebook and then tag that user in the same photo, I have tried a few methods but none seem to work.The photo will upload via this method it ju

I am trying to upload a photo to开发者_如何学C a user's Facebook and then tag that user in the same photo, I have tried a few methods but none seem to work. The photo will upload via this method it just doesnt assign the tags. I don't know how to make another call to tag the photo as I also get this error:

Fatal error: Uncaught OAuthException: (#121) Invalid photo id thrown in /sdk/base_facebook.php on line 970

Here is my code:

$tag = array(
        'tag_uid' => $facebook->getUser(),
        'x' => 0,
        'y' => 0
    );
    $tags[] = $tag;
$args = array(
  'message' => 'caption',
  'image' => '@'.realpath("watch.jpg"),
  'tags' => $tags,
);

$data = $facebook->api('/me/photos', 'post', $args);


The issue was because I didn't have the user_photos permission set!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号