0

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.

fondillusions
  • 189
  • 1
  • 2
  • 13

1 Answers1

0

Yes you are right,

The privacy setting is based on that user's privacy settings.

Click Here To See

Permissions

A user access token with `user_photos` permission is required to see all photos that person is tagged in or has uploaded.

So if user 2 is tagged in a picture and also they own it, only user 1 will show up cause they are the only one who accepted the permission approval.

In order for a friend to show up I believe they would have to accept your app by logging in and accepting the permissions you are requesting in your array user_photos

Also I believe there are settings on facebook that can let them not allow people to see what they are tagged in.

You can test this theory by going into your facebook app developers.facebook.com @ Click Here

go to your app/roles Add Testers . Then have them access your application and see if you can see if they are tagged in a photo now once they have accepted.

I am not sure what will happen, but this would be the appropriate way to test it.

wuno
  • 9,547
  • 19
  • 96
  • 180
  • I don't understand. So when I use the api/privacy setting to post a photo onto facebook, only people who are using my app can see the post? Also, I have already tested it using testers.. User 1 tagged user 2, and in the privacy allowed user 3 to see the photo, however user 3 can't see the photo still. When I don't specify the privacy, all users can see the post. Confused. – fondillusions Aug 04 '14 at 10:15