(#210) 用户不可见

发布于 2024-12-05 17:50:51 字数 1841 浏览 6 评论 0原文

我正在编写一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丑丑阿 2024-12-12 17:50:51

你是否验证过用户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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文