Facebook Graph API Overrides Privacy Settings Explicitly

I'm having problems setting privacy for messages created by my application as a user.

The problem is that all messages get the privacy value set as ALL_FRIENDS using the Graph API, although I explicitly set the privacy value for ALL.

This is the code I use to send:

$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); 

Here it is.

This code worked fine until I noticed it in August.

Does anyone else have this problem?

+7
source share
3 answers

This is due to the new privacy control after publishing the application, if it is set to Friends, so this application can only set privacy as friends.

Please read the following blog post for more information: https://developers.facebook.com/blog/post/543/

+7
source

In your example, you are creating a comment, not a post. Comments do not support the privacy = {} parameter.

+1
source

This is not in their graphical APIs, but they changed โ€œeverythingโ€ to โ€œpublicโ€ in this month's user interface to try to clarify to users what โ€œeveryoneโ€ meant ...

try using '{"value":"PUBLIC"}' and see if it works.

0
source

All Articles