Iphone 使用ios6在xcode 4.5中从facebook获取用户详细信息
我已经在我的应用程序中实现了整合facebook登录的概念。 1-->我可以登录facebook,但在用户登录facebook后,我想继续使用我的应用程序,即出现一个带有三个选项卡项的tabbarController,同时我需要获取facebook用户详细信息电子邮件、名字、姓氏等 但我无法检索详细信息。我不明白我错在哪里 在my ViewController.m中:Iphone 使用ios6在xcode 4.5中从facebook获取用户详细信息,iphone,objective-c,ios,xcode,facebook-login,Iphone,Objective C,Ios,Xcode,Facebook Login,我已经在我的应用程序中实现了整合facebook登录的概念。 1-->我可以登录facebook,但在用户登录facebook后,我想继续使用我的应用程序,即出现一个带有三个选项卡项的tabbarController,同时我需要获取facebook用户详细信息电子邮件、名字、姓氏等 但我无法检索详细信息。我不明白我错在哪里 在my ViewController.m中: - (IBAction)performLogin:(id)sender { AppAppDelegate *appDel
- (IBAction)performLogin:(id)sender
{
AppAppDelegate *appDelegate = (AppAppDelegate *) [[UIApplication sharedApplication] delegate];
[appDelegate openSessionWithAllowLoginUI:YES];
UITabBarController *tabBarController=[[UITabBarController alloc]init];
SearchViewController *searchViewController=[[SearchViewController alloc]initWithNibName:@"SearchViewController" bundle:nil];
UserProfile *userprofile=[[UserProfile alloc]initWithNibName:@"UserProfile" bundle:nil];
userprofile.title=@"My Profile";
LogOut *logout=[[LogOut alloc]initWithNibName:@"LogOut" bundle:nil];
logout.title=@"Log Out";
tabBarController.viewControllers=[NSArray arrayWithObjects:searchViewController,userprofile,logout, nil];
[self presentModalViewController:tabBarController animated:YES];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(sessionStateChanged:)
name:FBSessionStateChangedNotification
object:nil];
}
- (void)sessionStateChanged:(NSNotification*)notification {
if (FBSession.activeSession.isOpen) {
[FBRequestConnection
startForMeWithCompletionHandler:^(FBRequestConnection *connection,
id<FBGraphUser> user,
NSError *error) {
if (!error) {
NSString *fbUserEmail= @"";
NSLog(@"%@",user);
fbUserEmail=[user objectForKey:@"email"];
AppAppDelegate *appDelegate = (AppAppDelegate *) [[UIApplication sharedApplication] delegate];
appDelegate.fbEmail=fbUserEmail;
}
}
];
}
}
但这里没有显示facebook登录页面,我得到了tabbarController,我无法获取检索用户详细信息
如何先显示facebook登录页面,然后再显示tabbarController和用户详细信息 您可以使用facebook Graph API获取facebook用户详细信息,下面的链接演示如何使用Graph API获取基本用户详细信息。检查此处:您可以使用facebook Graph API获取facebook用户详细信息,下面的链接演示如何使用Graph API获取基本用户详细信息。检查此处:是的,Facebook还更新了最新版本xcode和ios的API。是的,Facebook也更新了最新版本xcode和ios的API。