Targeting a user in with /me/feed with the Facebook Graph API PHP SDK
Trying to target a user in a post with the Facebook Graph API, using the PHP SDK.
The posting works but the users is not highlighted in any way. Is it even possible to target a user in the posts nowadays? I know I had it done, but that was maybe a year ago.
Here is my code.
$facebook->api('/me/feed',
'POST',
array(
'access_toke开发者_如何学Pythonn' => 'the_token',
'message' => 'Hello Some Username, this is my world.',
'to' => array(
'data' => array(
array(
'name' => 'Some Username',
'id' => '1111110000000'
)
)
),
)
);
Just wanted to clarify - are you asking how your message can adapt to the user name automatically? If so, the only place you can use it is in the caption field. You have to use {actor} in your text and Facebook will do the replace for you but as mentioned, it's been crippled down to only the caption field of a feed post.
Solved it by instead of doing /me/feed
doing /{friend_id}/feed
Works.
精彩评论