FB.UI Feed Dialog - cannot “share” a facebook's picture

十年热恋 提交于 2020-01-04 04:35:12

问题


Sharing facebook photo (really a facebook photo) using mobile web app & Feed Dialog.

The problem: Cannot send facebook's photo to the Feed Dialog.

All code works great. I get all properties as they sent to the function.

    FB.ui
        method: "feed"
        link: 'url'
        app_id: myAppID
        name: 'photo's name'
        description: ''
        caption: $('#albumName').text()
        picture: 'http://myUrl.com/logo.png'

    , (response) ->
        if response and response.post_id
            console.log 'Photo was shared'
        else
            console.log 'Photo was not shared. Please try again'

If I place a static photo, to represent the Picture parameter, all goes fine, But if I try to call a facebook picture I try to share, then I get a 500 server error.

GET https://www.facebook.com/dialog/feed?access_token=...662390597_s.jpg&sdk=joey 500 (OK)

This is totally bizarre. The URL that goes to the dialog iframe, goes with all the needed parameters, including access_token.

It seems like a design issue. Like someone in facebook don't want us to pretend to be facebook when we customly share things using their feed dialog, when we share facebook photos.

Am I right?

* Problem Solved. See my answer below *


回答1:


!!! Problem Solved !!!

Facebook don't accept their own CDN as a source. We need to bypass that in order to share, therefore we can reshare a facebook the photo using a proxy.

http://images.weserv.nl does the job. Facebook accept the image as a picture param, and this way you are able to reshare their posts.

Usage example (plus width and hight to improve performance)

'https://images.weserv.nl/?url=' + facebookImageUrl + '&h=200&w=200'



回答2:


I can't share facebook photo use this example when i share with (fb.ui method feed) i get 404 error on this link

https://fbexternal-a.akamaihd.net/app_full_proxy.php?app=460125687444228&v=1&size=z&cksum=047536ba625482c9b5343f2eb94a7039&src=https%3A%2F%2Fimages.weserv.nl%2F%3Furl%3Dhttps%253A%252F%252Ffbcdn-sphotos-b-a.akamaihd.net%252Fhphotos-ak-ash4%252Ft1.0-9%252F10157304_1383818341898181_8685912667835736794_n.jpg%26h%3D200%26w%3D200"

"app=460125687444228
cksum=047536ba625482c9b5343f2eb94a7039
size=z
src=https://images.weserv.nl/?url=https%3A%2F%2Ffbcdn-sphotos-b-a.akamaihd.net%2Fhphotos-ak-ash4%2Ft1.0-9%2F10157304_1383818341898181_8685912667835736794_n.jpg&h=200&w=200
v=1"

Where my error ?



来源:https://stackoverflow.com/questions/22647805/fb-ui-feed-dialog-cannot-share-a-facebooks-picture

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