1

I would like for the user to share client side image on facebook with the feed dialog or other approach

FB.ui({ method: 'feed',
caption: 'Mega Tangram Picture',
message: 'I made this tangram picture on MegaTangram',
picture: canvas.toDataURL("image/png;base64;")
}, function(response){console.log(response);}); 

Its not working with the dataURL standard, is there another way to do this (graph api?), it must be possible to share dynamically created images that are not held on the server?

The error I got was:

An error occurred. Please try again later.

API Error Code: 100
API Error Description: Invalid parameter
Error Message: picture URL is not properly formatted

checkupdatefeed result parameter= undefined script.js:1183
checkupdatefeed result parameter= 1390679958266:9.4.0 

When trying with image/jpeg;base64, I get the following error:

Could not find callback 1
4

2 回答 2

1

据我所知,这是不可能的。当您在提要中分享内容时,Facebook 需要能够从公共 URL 获取图像。

图片:附加到此帖子的图片的URL 。

来源:Feed 和 Share 对话框

您需要先将图像上传到某处(例如Amazon S3)。

于 2014-01-26T18:37:32.690 回答
0

您可以将画布图像上传到保管箱,然后在 facebook 提要 url 中使用生成的 url -使用画布中的数据将图像保存到保管箱

于 2016-07-02T06:01:26.687 回答