Facebook SDK,是否可以通过用户名获取所有用户? [英] Facebook SDK, Is it possible to fetch all users by username?
问题描述
在我的新项目中,客户需要,如果他通过任何名称,那么它会给你所有用户的列表(即他们的公开的个人资料)。 用于用户数据的Graph API
这表示我可以通过这样的用户ID获取用户详细信息,
FBSDKGraphRequest * request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@/ {user-id}
参数:params
HTTPMethod:@GET];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection * connection,
id result,
NSError * error){
//处理结果
}];
但是,如果我想通过用户名获取所有用户,如Facebook在搜索控制器中?
例如,如果我通过 任何人都可以帮助? 我找到了我的答案这里。 我可以通过用户名来获取所有用户,这里是一个例子: 这将给我JSON所有用户名为 In my new project, client need that if he pass any name then it will give you list of all users(i.e. their public profiles). I saw in Graph API for User data. That is states that I can get user details by user-id like this, But what if I want to fetch all users by username only, like facebook does in it's search controller? For example If I pass Anybody can help? I found my answer Here. I can get all user's by user name only, here is an example: This will give me JSON of all users with named 这篇关于Facebook SDK,是否可以通过用户名获取所有用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Steve Jobs
,那么它将列出所有名为
$ b
https://graph.facebook.com/search ?q = Steve + Jobs& type = user& access_token = {access_token}
Steve Jobs
。FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{user-id}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Steve Jobs
, then It will give list of all users named Steve Jobs
.https://graph.facebook.com/search?q=Steve+Jobs&type=user&access_token={access_token}
Steve Jobs
.