Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook publish_actions - default visibility to friends of friends

I use publish_actions scope to post on user's behalf like so:

https://www.facebook.com/dialog/oauth?client_id=%s&redirect_uri=%s&state=%s&scope=publish_actions

This shows the user a dialog where the default visibility level is set to 'Friends'. For example see the little dropdown at the bottom left of the screenshot shown here

Is it possible to have this visibility level to be set to 'Friends of Friends' by default?

like image 846
arahant Avatar asked May 24 '13 05:05

arahant


1 Answers

It's not possible to set the visibility programatically during the Login Permission Dialog.

What you can theoratically do is setting the privacy level while publishing a post for a user (if you have the publish_actions permission):

  • https://developers.facebook.com/docs/graph-api/reference/v2.2/user/feed#publish

This will NOT overwrite the standard setting the user selected privacy level during login. So, if I chose "Friends", then the app will not be able to post to friends of friends.

Example:

POST /v2.2/me/feed

Raw Body:

message=Test+message&privacy={"value":"FRIENDS_OF_FRIENDS"}

results in

{
    "id": "{post_id}"
}

Check:

/{post_id}?fields=id,message,privacy

results in

{
  "id": "{post_id}", 
  "message": "Test message", 
  "privacy": {
    "description": "Your friends", 
    "value": "ALL_FRIENDS", 
    "friends": "", 
    "networks": "", 
    "allow": "", 
    "deny": ""
  }, 
  "created_time": "2015-01-26T14:49:39+0000"
}
like image 109
Tobi Avatar answered Oct 28 '22 20:10

Tobi