1
按照文件上 http://developers.facebook.com/docs/howtos/user-data-ios-sdk/#step3沒能得到朋友的生日
我使用下面的代碼作爲許可得到朋友的生日
appdelegate.m
- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"user_location",
@"user_birthday",
@"user_likes",
nil];
return [FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
[self sessionStateChanged:session
state:state
error:error];
}];
}
和視圖控制器.mi正在使用後面的代碼在視圖中加載了
NSString *query =
@"SELECT uid, name, birthday, birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)";
// Set up the query parameter
NSDictionary *queryParam =
[NSDictionary dictionaryWithObjectsAndKeys:query, @"q", nil];
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:queryParam
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
NSLog(@"Result: %@", result);
}
}];
但我無法得到朋友生日日期..沒有請求發送給朋友訪問他的生日..
任何想法?