开发者

FB.ui feed post dialog changes

开发者 https://www.devze.com 2023-04-02 06:08 出处:网络
When a user posts a comment on one of our sites, we give them the option to send the comment to their facebook wall.i.e. the following code:

When a user posts a comment on one of our sites, we give them the option to send the comment to their facebook wall. i.e. the following code:

FB.ui({
    method: "stream.publish",
    attachment: {
        "name": "article title",
        "href": document.location.href,
        "description": "an excerpt from the article"
    }
    message: userComment, // The comment that the user entered on our site
    user_prompt_message: shareText // "What do y开发者_StackOverflow社区ou think?" or similar, configurable
}, function(response){
    if(response && response.post_id){
        // success!
    }
    else{
        // failed!
    }
});

This popped up a dialog with the "your comment here" input pre-filled with the same comment the user posted on our site. Was totally fine via the Facebook Platform Policies, even officially encouraged at the time we initially put it into place.

But evidently they deprecated the message parameter on July 12th. So now you get a big "share" box and the content you actually want to share (the user's comment) isn't included anywhere. So, we're looking for another way to post the user's comment.

So, the latest documentation on stream.publish still says we can pass the message parameter directly via the API call, i.e.

https://api.facebook.com/method/stream.publish?callback=derp&message=EABOD+Facebook&access_token=MY_ACCESS_TOKEN&format=json

I tested it and it works, but I'm wondering if it will still work going forward, or if they just haven't shut it down yet?


If it'll replaced, i will be the feed method, which is very similar to streem method.

    FB.ui(
    {
        method: 'feed',
        link: 'http://myapp.com/myitem',
        display: 'iframe',
        picture: 'http://myapp.com/mylogo.jpg',
        message: 'my message',
        name: 'click to see item',
        caption: 'title'
    })

we will see next major version and see!

0

精彩评论

暂无评论...
验证码 换一张
取 消