我想使用Facebook Api获取Facebook好友列表。因此,我在Facebook上创建了新应用,并获得了AppID,并在我的原生iOS应用中使用该AppID和Bundle ID时提供Bundle ID,并使用api获取所有朋友列表以获取空朋友列表。使用我的FacebookAppID在iOS中无法使用
如果我使用"SendRequestHowTo"示例项目的应用程序ID,它将获得登录用户的所有朋友列表。告诉我如何在Facebook开发人员站点上配置我的新应用程序以获取好友列表。
我对获得好友列表代码:
// Query to fetch the active user's friends, limit to 25.
NSString *query =
@"SELECT uid, name, pic_square FROM user WHERE uid IN "
@"(SELECT uid2 FROM friend WHERE uid1 = me())";
// Set up the query parameter
NSDictionary *queryParam = @{ @"q": query };
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:queryParam
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
_friends_list = (NSArray *) result[@"data"];
NSLog(@"Result: %@", result);
[self getLetsWalkeeFriendList];
// Sort Table Data
[self sortTableView];
// [_tbl_view_friends reloadData];
}
[self.view setUserInteractionEnabled:YES];
// [self.view hideToastActivity];
}];
使用示例项目的AppID(即FacebookAppID:403223126407920和捆绑IDENTIFER:com.facebook.samples.SendRequestsHowTo)。当我与Facebook登录我输出
Result: {
data = (
{
name = "Assad Sarwar";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpa1/t1.0-1/c153.5.545.545/s50x50/1978738_766566543368250_230425531_n.jpg";
uid = 100000447351759;
},
{
name = "Muhammad Hassan Butt";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/t1.0-1/c0.0.50.50/p50x50/10167970_873047696055100_7845811348955741805_n.jpg";
uid = 100000496339789;
},
{
name = "Umair Jafar";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/t1.0-1/c0.2.50.50/p50x50/10500337_910092152350902_4827832642500691993_n.jpg";
uid = 100000503784242;
}, .........
)
}
,当我用我的AppID这是由Facebook和使用相同的用户进行登录到Facebook的规定,我得到了像
Result: {
data = ()
}
去developer.facebook.com – NullData