[英]How to tag and upload image on user's facebook profile profile using JS and API
如何标记图像并将其上传到应用程序的用户个人资料?
我正在使用以下对我不起作用的代码。
在结果页面上之后,用户在应用程序的登录页面上将上传,发布和offline_access范围授予了我的应用程序。
我正在使用此代码:
function graphStreamPublish(session){
showLoader(true);
FB.api('/me/feed', 'post',
{
message : "trying to publish image",
picture : 'http://localhost:8085/myweb/images/arranged2.jpg',
name : 'This is my demo Facebook application (JS SDK)!',
description : 'It is fun to write Facebook App!!'
},function(response) {
showLoader(false);
if (!response || response.error) {
alert('Error occured');
} else {
alert('Post ID: ' + response.id);
}
});
}
我是否还需要在页面上执行Fb.init?
我在<body>
标记后放置了上面的代码,对吗?
如何在同一张图片上标记用户?
这将不起作用,facebook-server将尝试下载picture-url,因为此URL为localhost
,这将失败,因为localhost
在此上下文中表示Facebook-Server,而不是您的服务器。 将图片URL替换为公共可用URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.