如何在FBSessionStateCreatedTokenLoaded发生时访问用户信息?

时间:2014-02-26 05:53:23

标签: ios facebook-login facebook-sdk-3.1

当用户启动应用程序时,如果会话存在,我需要检查会话,我需要获取特定的用户会话信息。

先谢谢。

我的代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   // userNameAppdel=[[NSString alloc]init];
    // Override point for customization after application launch.

    FaceBookLoginViewController *FBObj =[[FaceBookLoginViewController alloc]init];

    coreDataManagerObj = [[CoreDataManager alloc]init];

    self.FBObj = FBObj;

    if (FBSession.activeSession.state == FBSessionStateCreatedTokenLoaded)
    {
        NSLog(@"Found a cached session");

        // I need to get user info here any one knows the solution please help.

    }


    else
    {
        UIButton *loginButton = [self.FBObj btn_FbLogin];

        [loginButton setBackgroundImage:[UIImage imageNamed:@"login_FB.png"] forState:UIControlStateNormal];
    }



    return YES;
}

0 个答案:

没有答案