我正在使用此代码来获取朋友的生日:
- (void)apiGraphFriendsWithBirthdays {
[self showActivityIndicator];
HackbookAppDelegate *delegate = (HackbookAppDelegate *)[[UIApplication sharedApplication] delegate];
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"picture,id,name,link,birthday,gender,last_name,first_name",@"fields",
nil];
[[delegate facebook] requestWithGraphPath:@"me/friends" andParams:params andHttpMethod:@"GET" andDelegate:self];
}
然后我打印以记录我提取的一些内容:
NSMutableArray *friends = [[NSMutableArray alloc] initWithCapacity:1];
NSArray *resultData = [result objectForKey:@"data"];
if ([resultData count] > 0) {
for (NSUInteger i=0; i<[resultData count] && i < 25; i++) {
[friends addObject:[resultData objectAtIndex:i]];
NSDictionary *friend = [resultData objectAtIndex:i];
long long fbid = [[friend objectForKey:@"id"]longLongValue];
NSString *name = [friend objectForKey:@"name"];
NSString *birthday = [[friend objectForKey:@"birthday"] description];
NSLog(@"id: %lld - Name: %@ - Birthday: %@", fbid, name,birthday);
}
} else {
[self showMessage:@"You have no friends."];
}
[friends release];
出于某种原因,我的一些朋友生日是空的,虽然我可以在Facebook上看到他们的生日。
这是我的代码还是某种特定的用户隐私设置?