使用sdks 4获取Facebook好友列表

时间:2015-08-13 12:45:35

标签: ios objective-c facebook

NSMutableDictionary* parameters = [NSMutableDictionary dictionary];

[parameters setValue:@"id,name,email" forKey:@"fields"];

FBSDKGraphRequest *friendsRequest =
[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/friends"
                                      parameters:parameters];
FBSDKGraphRequestConnection *connection = [[FBSDKGraphRequestConnection alloc] init];
[connection addRequest:friendsRequest
         completionHandler:^(FBSDKGraphRequestConnection *innerConnection, NSDictionary *result, NSError *error)
     {
             NSLog(@"fetched user:%@", result);
         }];
    // start the actual request
[connection start];

0 个答案:

没有答案