使用Javascript分享动画GIF到Facebook [英] Share animated GIF to Facebook using Javascript

查看:123
本文介绍了使用Javascript分享动画GIF到Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在Facebook支持分享动​​画GIF,我想制作一个简单的按钮,从图库中分享选定的GIF,如下所示:

  var obj = {
method:'feed',
source:'http://img-9gag-fun.9cache.com/photo/aApVdqZ_460sa.gif',
图片:'http://img-9gag-fun.9cache.com/photo/aApVdqZ_460sa.gif',
名称:'FB POST NAME GIF',
标题:'FB POST CAPTION GIF ',
描述:'FB POST MESSAGE GIF'
};
FB.ui(obj);

但它不工作。



如果我直接发布该网址,墙壁完美无缺,但通过动作(javascript)只是使其成为一个普通的帖子,就像是一个JPG。



有没有人知道如何解决这个问题?



谢谢

解决方案

我遇到同样的问题,我找到了一个在Facebook上发布GIF的解决方案。



使用方法我/ feed / 并将gif网址放在链接下对象



示例:

  FB.api(
'me / feed /',
'POST',
{
message:'这是一个GIF',
链接:'http://25.media.tumblr.com/08d54accc4beb56a50e752fd931c6b58/tumblr_mlsyqrzwWQ1s3g3ago1_400.gif'
},
函数(响应){
console.log(response);
}
);

它为我工作,希望它适合你。



PS:我使用的是2.5 API。


Now that Facebook supports the sharing of animated GIFs, I want to make a simple button that shares a selected GIF from a gallery, like this:

var obj = { 
    method: 'feed',
    source: 'http://img-9gag-fun.9cache.com/photo/aApVdqZ_460sa.gif',
    picture: 'http://img-9gag-fun.9cache.com/photo/aApVdqZ_460sa.gif',
    name: 'FB POST NAME GIF',
    caption: 'FB POST CAPTION GIF',
    description: 'FB POST MESSAGE GIF'
};
FB.ui(obj);

But it doesn't work.

If I post that URL directly, the wall works perfectly but through the action it (javascript) just makes a normal post as if it were a JPG.

Does anyone knows how to fix this?

Thanks

解决方案

I've faced the same problem and I found a solution to post GIFs on Facebook

use the method me/feed/ and put the gif url under the link object

example:

FB.api(
  'me/feed/',
  'POST',
  {
    message: 'This is a GIF',
    link: 'http://25.media.tumblr.com/08d54accc4beb56a50e752fd931c6b58/tumblr_mlsyqrzwWQ1s3g3ago1_400.gif'
  },
  function(response) {
    console.log(response);
  }
);

It worked for me I hope it works for you.

PS: I'm using the 2.5 API.

这篇关于使用Javascript分享动画GIF到Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆