简体   繁体   中英

facebook php sdk – posting to specific friend lists

I am trying to post to specific friend lists through php in combination with a facebook canvas app. When I call the app the first time I have to decide who can see the posts the app will do ie public, close friends or specific friend lists.

So when I've decided me for all friend lists and another friend list was added by user I can't post to this new friend list through php without adding this friend list manually on facebook. But that is exactly what I want to do. Is there any way to do that?

In addition: Getting those friend lists is not the problem.

EDIT

The following code doesn't work for me.

$response = (new FacebookRequest(
    $session,
    "POST",
    "/me/feed",
    array(
        "message"       => "Some message",
        "value"         => "CUSTOM",
        "friends"       => "SOME_FRIENDS",
        "allow"         => "listId"
    );
))->execute();

There´sa "privacy" field for that, as you can read in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.4/user/feed#publish

Determines the privacy settings of the post. If not supplied, this defaults to the privacy level granted to the app in the Login Dialog. This field cannot be used to set a more open privacy setting than the one granted.

You can´t just use "value", "allow" and "deny" like that. Information about how to do that correctly can be found in several other threads:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM