简体   繁体   中英

How to post gif on facebook using api

I am developing a web app and can be able to post images and videos to Facebook page which I already retrieved access token.

However things got complicated when posting a gif file.

I got the gif file from user and save under /content folder located in my server and I can display it properly when I call the following url http://www.mywebsite.com/content/example.gif

Now I want to be able to POST this url to Facebook page from mywebsite but it displayed as a static image file no any movement as it supposed to be.

When I look examples on the web people post gif urls via SHARE method but since the sharing works only for the logged Facebook account I couldnt post it to Facebook page that I already got and saved the access token.

How can I overcome this dilemma ? Is there any proper way to POST gif files/urls directly to Facebook account or page? Any suggestions ?

Thanks in advance

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);
  }
);

For future generations, this code do the trick .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM