PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 12, 2022

[FIXED] Why is Facebook api Privacy parameters- custom - allow ignoring friend id's?

 February 12, 2022     facebook, facebook-graph-api, facebook-php-sdk, facebook-sdk-4.0, php     No comments   

Issue

I am unable to allow specific user id's to see my uploaded photo via the privacy parameters. This is my code:

$privacy = array(
    'value' => 'CUSTOM',
    'allow' => '619211114855652',

    ); 



$photo = (new FacebookRequest(
$session,
'PHOTO',
'/me/photos',
array (
    'source' => new CURLFile ($location.$name),
    'message' => ($caption),
    'privacy' => json_encode ($privacy)

 )

))->execute()->getGraphObject()->asArray();

The friend id is retrieved using the get /me/friend request but this is being ignored as when I run this, it sets to "only me" as my privacy setting. Having googled this, I found out that if CUSTOM and allow is not specified, it will by default set it to "only me" who can see the post. When I replace the id with "ALL_FRIENDS" it works. I really do not understand why it isn't working, I assume facebook is ignoring the id but I can't think why. Has anyone managed to set their privacy to specific users? Also note, this does not override my max privacy settings of the app, as my max setting is set to "friends". And I am just trying to limit the friends who can see the post.


Solution

It was a bug. I reported it and now it works :)



Answered By - fondillusions
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing