我用这个概念来登录。
-(void)LoginButtonTapped
{
NSArray *permissions = [[NSArray alloc]initWithObjects:@"friends_email",@"user_birthday",@"user_hometown",@"user_location",@"friends_birthday",@"friends_location",@"friends_hometown", nil];
[[delegate facebook]authorize:permissions];
[FBSession.activeSession openWithCompletionHandler:^(FBSession *session,
FBSessionState state,
NSError *error)
{
NSLog(@"success");
// [signinbutton setHidden:YES];
}
}];
[permissions release];
}
但是,假设如果我在没有登录的情况下关闭登录窗口,那么它不会再次显示登录窗口。
它显示了这个错误。
*** Terminating app due to uncaught exception 'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: an attempt was made to open an already opened or closed session'
任何想法请帮助我。