开发者

Problem posting to the user's wall using Graph Api

开发者 https://www.devze.com 2023-01-14 13:28 出处:网络
I am trying to post to the wall. It does not work when i add arguments like link, name and caption. function graphStreamPublish(){

I am trying to post to the wall. It does not work when i add arguments like link, name and caption.

function graphStreamPublish(){
                var body = 'This is a tes开发者_高级运维t feed';
                var url = 'http://www.my-site.com';
                var heading = 'Check out the link.';
                var caption = 'I am trying to get it work.';  
                FB.api('/me/feed', 'post', { message: body, link: link, name: heading, caption: caption}, function(response) {
                    if (!response || response.error) {
                        alert('Error occured');
                    } else {
                        alert('Post ID: ' + response.id);
                    }
                });
            }

I understand the link, name and caption are cceptable parameters. Am i missing something. It works fine with just message argument.

I appreciate all your help.

Thanks.


First of all your link variable name is url and you are sending link.

I think I know what's the problem. Facebook doesn't like posting a link without a description (undocumented feature?). I faced similar problem, when I added description to the message it went through.

0

精彩评论

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