More action links in single wallpost

人盡茶涼 提交于 2019-12-03 17:30:07

I got a response from Facebook and you really can not add more than one action link.

Correct code for adding one link is:

var publish = {
    // ....
    actions : {
        name : 'Some Action Link!',
        link : 'http://www.example.com'
        }
};

Yes.

According to http://developers.facebook.com/docs/reference/rest/stream.publish/, the action_links parameter is a "JSON-encoded array of action link objects, containing the link text and a hyperlink."

It looks like you're calling it actions, not action_links. Try this instead:

var publish = {
    method : 'feed',
    name : name,
    link : link,
    picture : picture,
    caption : caption,
    description : description,
    message : message,
    action_links : [{
        name : 'Link 1',
        link : 'http://www.example.com'
        },{
        name : 'Link 2',
        link : 'http://www.example2.com'
        }]   
};
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!