我正在使用Facebook api来获得相互的朋友,但使用相同的帐户,我在模拟器和实际设备上获得了不同数量的相互朋友。我使用的代码如下:
NSDictionary *params = @{
@"fields": @"context.fields(all_mutual_friends.fields(picture.width(200).height(200),id,name)),id,name"
};
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:[NSString stringWithFormat:@"/%@",facebookId]
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
if (error) {
NSLog(@"%@", error);
} else {
NSLog(@"%@", result);
NSArray *fbResData = [app checkArrayNull:[[[result objectForKey:@"context"] objectForKey:@"all_mutual_friends"] objectForKey:@"data"]];
NSLog(@"%@", fbResData);
}
}];
转载请注明出处:http://www.shenkehuoyun.com/article/20230526/1917171.html