I am trying to set the privacy of a photo. I have tagged tester 1 and specify that I would like to share this photo with just tester 2.
I have the following code:
$privacy = array(
'value' => 'CUSTOM',
'friends' => 'SOME_FRIENDS',
'allow' => 'tester 2 id',
);
$photo = (new FacebookRequest(
$session,
'PHOTO',
'/me/photos',
array (
'source' => new CURLFile ($location.$name),
'message' => ($caption),
'privacy' => json_encode ($privacy),
)
))->execute()->getGraphObject()->asArray();
//echo '<pre>' . print_r( $photo, 1) . '</pre>';
$photo_id = $photo['id'];
echo $photo_id;
$tags = array( array( 'tag_uid' => $friend_id, 'x' => 0, 'y' => 0 ));
// call api to tag friend to photo, with json_encoded $tags
$tag = (new FacebookRequest( $session, 'POST', '/'.$photo_id.'/tags',
array(
'tags' => json_encode( $tags ) ) ))->execute()->getGraphObject()->asArray();
I have no included the id of tester 2 but in my app, I have the id. When I run this, on my facebook the privacy shows that only I can see it - "only me" and whoever is tagged. For tester 1, it says the privacy setting is "custom".
I am not sure what the problem is. Why it says "only me" when I have specify "custom" and a friend id.