我正在尝试从 facebook 获取正在使用我的应用程序的朋友,但在响应中我得到了空列表列表。请指导我做错了什么。我正在使用以下代码
[[FBRequest requestForMe] startWithCompletionHandler: ^(FBRequestConnection *connection, NSDictionary<FBGraphUser> *user, NSError *error) {
if (error) {
//error
NSLog(@"%@",error);
}else{
FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,NSDictionary* result,NSError *error) {
NSArray* friends = [result objectForKey:@"data"];
NSLog(@"%@",result);
for (NSDictionary<FBGraphUser>* friend in friends)
{
NSLog(@"%@ %d",friend.username,[friend.id intValue]);
}
}];
}
}];
谢谢