(#210) 用户不可见
我正在编写一个 Facebook 应用程序,其中登录用户 (a) 从他们的朋友列表 (b) 中选择一个朋友,然后应用程序在他们的朋友墙上发帖(a 发帖到 b)。
我向用户请求 publish_stream
权限。
这是显示朋友选择器弹出窗口的代码:
function selectFriends() {
FB.ui({
method: 'apprequests',
message: 'You should learn more about this awesome game.', data: 'tracking information for the user'
},function(response) {
if (response && response.request_ids) {
//alert(typeof(response.request_ids));
//alert(response.request_ids);
alert (response.request_ids);
len=response.request_ids.length;
alert(len);
if (len>2) {
alert("Select no more than one friend");
}
else {
user_req_id = response.request_ids[0];
postOnFirendsWall(user_req_id);
}
}
else {
alert('Post was not published.');
}
});
}
这是 postOnFirendsWall(user_req_id)
方法:
function postOnFirendsWall(friend_id)
{
/** Auto Publish **/
var params = {};
params['message'] = 'message';
params['name'] = 'name';
params['description'] = '';
params['link'] = 'https://www.link.com/';
params['picture'] = 'http://profile.ak.fbcdn.net/hprofile-ak-snc4/203550_189420071078986_7788205_q.jpg';
params['caption'] = 'caption';
var stam = '/'+friend_id+'/feed';
FB.api('/'+friend_id+'/feed', 'post', params, function(response) {
if (!response || response.error) {
alert('Error occured');
alert(response.error);
} else {
alert('Published to stream - you might want to delete it now!');
}
});
return false;
}
但我不断收到以下错误:(#210) 用户不可见。
你能明白为什么吗?
I'm writing a facebook app in which the logged in user (a) chooses a friends from their friends list (b) and then the app posts on their friends wall (a posts to b).
I ask from the user the publish_stream
permissions.
This is the code for showing the friends selector popup:
function selectFriends() {
FB.ui({
method: 'apprequests',
message: 'You should learn more about this awesome game.', data: 'tracking information for the user'
},function(response) {
if (response && response.request_ids) {
//alert(typeof(response.request_ids));
//alert(response.request_ids);
alert (response.request_ids);
len=response.request_ids.length;
alert(len);
if (len>2) {
alert("Select no more than one friend");
}
else {
user_req_id = response.request_ids[0];
postOnFirendsWall(user_req_id);
}
}
else {
alert('Post was not published.');
}
});
}
This is the postOnFirendsWall(user_req_id)
method:
function postOnFirendsWall(friend_id)
{
/** Auto Publish **/
var params = {};
params['message'] = 'message';
params['name'] = 'name';
params['description'] = '';
params['link'] = 'https://www.link.com/';
params['picture'] = 'http://profile.ak.fbcdn.net/hprofile-ak-snc4/203550_189420071078986_7788205_q.jpg';
params['caption'] = 'caption';
var stam = '/'+friend_id+'/feed';
FB.api('/'+friend_id+'/feed', 'post', params, function(response) {
if (!response || response.error) {
alert('Error occured');
alert(response.error);
} else {
alert('Published to stream - you might want to delete it now!');
}
});
return false;
}
But I keep getting the following error: (#210) User not visible.
Can you see why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是否验证过用户A有权限在用户B的墙上写字?如果没有,这将永远行不通。
另外,如果您想在朋友的墙上发帖,为什么要使用应用请求对话框?
Have you verified that user A has permission to write on the wall of user B? If not, this will never work.
Also, why are you using an apprequests dialog if you want to post on a friend's wall?