我正在尝试获取所有我的Facebook朋友的列表,谁正在使用应用程序我得到所有的朋友的列表,但是如何过滤所有使用该应用程序的朋友?
FBRequest* friendsRequest = [FBRequest requestForMyFriends]; [friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,NSDictionary* result,NSError *error) { NSArray* friends = [result objectForKey:@"data"]; NSLog(@"Found: %i friends",friends.count); for (NSDictionary<FBGraphUser>* friend in friends) { NSLog(@"I have a friend named %@ with id %@",friend.name,friend.id); } NSArray *friendIDs = [friends collect:^id(NSDictionary<FBGraphUser>* friend) { return friend.id; }]; }];
谢谢.
解决方法
这是iOS5如何运作的方式
FBRequest* friendsRequest = [FBRequest requestWithGraPHPath:@"me/friends?fields=installed" parameters:nil HTTPMethod:@"GET"]; [friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,NSError *error) { NSArray* friends = [result objectForKey:@"data"]; NSLog(@"Found: %i friends",friends.count); for (NSDictionary<FBGraphUser>* friend in friends) { NSLog(@"I have a friend named %@ with id %@",friend.id); } NSArray *friendIDs = [friends collect:^id(NSDictionary<FBGraphUser>* friend) { return friend.id; }]; }];