本教程展示了如何集成 Facebook SDK 3.0 来上传法规和发布图片到用户墙。希望这会有所帮助:http: //xcodenoobies.blogspot.com/2012/09/how-to-upload-photo-and-update-status.html
您可以通过单个 fql 请求检索您(或用户)的 Facebook 朋友的生日。
您可以在此处阅读有关 fql 的信息:http: //developers.facebook.com/docs/reference/fql/
但这里有一些代码供参考(此代码在定义为 FBSessionDelegate 和 FBRequestDelegate 的类中)
- (void)request:(FBRequest *)request didLoad:(id)result {
// result is a NSDictionary of your friends and their birthdays!
}
- (void)fbDidLogin {
//some best practice boiler plate code for storing important stuff from fb
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
[defaults synchronize];
//now load all my friend's birthdays
NSMutableDictionary * params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
@"select birthday, name, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by name",
@"query",
nil];
[self.facebook requestWithMethodName: @"fql.query" andParams: params andHttpMethod: @"POST" andDelegate: self];
}
- (void) loginWithFacebook {
self.facebook = [[[Facebook alloc] initWithAppId:@"<your app id here>" andDelegate:self] autorelease];
//IMPORTANT - you need to ask for permission for friend's birthdays
[facebook authorize:[NSArray arrayWithObject:@"friends_birthday"]];
}