如何通过Facebook获取朋友的ID? [英] How to get friends' id via Facebook?

查看:1204
本文介绍了如何通过Facebook获取朋友的ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经得到了用户的手机联系人列表。当用户点击联系我想我的应用程序对他的墙公布。我会用饲料对话框,参数TO。但是,我需要Facebook好友的ID和名字的名单。然后,我会选择这个名字的帮助sutable ID。

I've got a list of user's phone contacts. When user clicks on the contact I want my app publish on his wall. I will use feed dialog with parameter "TO". But for that I need list of Facebook friend's id and name. Then I'll select sutable id with the help of the name.

我已经做出授权,并设法使ID请求在三个方面。以下是第一条:

I've already make authorization and tried to make id request in three ways. Here is the first:

if(session.getState().isOpened()){
        Log.i(TAG, "Creating request");
        Request friendRequest = new Request(session, "/me/taggable_friends", null,  HttpMethod.GET, new Request.Callback() {
            public void onCompleted(Response response) {
                Log.w(TAG, "Complete");
                progressDialog.dismiss();
            }
        });


        Log.i(TAG, "Sending request");
        friendRequest.executeAsync();
    }

和第二个:

Request friendRequest = Request.newMyFriendsRequest(session,
                new Request.GraphUserListCallback(){
                    @Override
                    public void onCompleted(List<GraphUser> users, Response response) {
                        Log.w(TAG, "Request successful");
                        progressDialog.dismiss();
                    }
                });

和第三:

Log.i(TAG, "Creating request");
        Request friendRequest =  new Request(session, "/me/friends", null, HttpMethod.GET, new Request.Callback() {
                    public void onCompleted(Response response) {
                        Log.e(TAG, "Complete");
                        progressDialog.dismiss();
                    }
                }
        );

        Log.i(TAG, "Sending request");
        friendRequest.executeAsync();

他们都没有返回值。 onComplited无效不启动。会议权限:

All of them returns nothing. onComplited void doesn't start. Session permissions:

[public_profile, user_likes, user_friends, user_status]

哪里是我的错?还是有其他方法吗?

Where is my mistake? Or is there any other ways?

推荐答案

taggable_friends 仅用于标记的朋友,你不应该使用它为别的,你会不明白这一点在审查过程中批准。你唯一的严重/允许的方式是使用 / ME /朋友,但请记住,你将只能得到授权谁你的App太多的朋友。这意味着你只能用谁授权你的App的朋友为到参数。

taggable_friends is for tagging friends only, you are not supposed to use it for anything else and you would not get it approved in the review process. The only serious/allowed way for you is to use /me/friends, but keep in mind that you will only get friends who authorized your App too. Which means that you can only use friends who authorized your App for the "to" parameter.

这篇关于如何通过Facebook获取朋友的ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆