I'm having problems setting the privacy for posts created by my App on behalf of the user.
The problem is that all the posts are getting their privacy value set as ALL_FRIENDS by the Graph API, even though I'm explicitly setting the privacy value to EVERYONE.
This is the code I'm using to submit:
$query = 'message='. urlencode($message) .'&privacy='. urlencode('{"value":"EVERYONE"}');
$url = 'https://graph.facebook.com/'. $obj_id .'/feed?access_token='. $user_fb_access_token;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($curl, CURLOPT_REFERER, $referrer);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
curl_close($curl);
Thats it.
This code worked perfectly up until sometime in August when I noticed it.
Anyone else having this issue?
This is related to the new per-app post privacy control, if is set to Friends so this App can only set privacy as wide as friends.
Please read the following blog post for more info: https://developers.facebook.com/blog/post/543/
In your example, you're creating a comment, not a post. Comments don't support the privacy={} parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With