Facebook Feed Dialog not showing Picture

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:23:48

问题


I'm using the feed dialog, and the picture that I'm trying to use isn't showing. The dialog comes up with the correct description and caption, but no picture.

Here's my javascript:

FB.ui(
  {
    method: 'feed',
    name: message,
    description: "...",
    caption: "...",
    link: "http://our_domain.com", 
    picture: "https://picture_stored_on_aws"
  },
  (response) ->
    window.close()
)

However, it works when I use a picture stored elsewhere, like this sample from the Facebook dev site: 'http://fbrell.com/f8.jpg'.

I tried removing the https, and still no picture. Anyone else come across this problem? Does it have anything to do with referencing a picture on aws?


回答1:


As you found out, the link you received in S3 has an expiration because the file is not available for the public, only for your own account. You would have to make your image public to use it in your Facebook Feed Dialog.

Log in to the AWS Console, go to S3, find and click on the file you want to use, click on "Properties" button at the top right. You will see a window at the bottom of the page. Click on the "Permissions" tab and make sure that there is a permission for "Open/Download" for "Everyone". When you switch back to the "Details" tab then, you will see a link that is public. With this image link, the picture should also show in your Facebook Feed Dialog.




回答2:


It may be use of https , test with http image URL in array

FB.ui(
  {
    method: 'feed',
    name: message,
    description: "...",
    caption: "...",
    link: "http://our_domain.com", 
    picture: "http://picture_stored_on_aws"
  },
  (response) ->
    window.close()
)



回答3:


I encountered the exact same problem using Django-storages with S3Boto backend. What solved if for me was removing all the GET parameters so if your original generated S3 link was:

https://[your account].s3.amazonaws.com/yourpic.jpg?Signature=[...]&Expires=[...]&AWSAccessKeyId=[...]

you need to parse it to:

https://[your account].s3.amazonaws.com/yourpic.jpg

This worked for me, I hope it helps someone else.



来源:https://stackoverflow.com/questions/12948475/facebook-feed-dialog-not-showing-picture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!