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!
精彩评论