我是fbsdk的新手,但我按照Facebook.developers网页上的确切程序将idk合并到我的应用中。 说完我还有问题。
我的应用程序为您提供了使用FBSDKLoginButton登录的选项,您登录后可以使用应用程序内的其他FBSDKLoginButton注销(读取注销)。
一切正常,您使用Facebook帐户登录,然后在应用程序中按下注销按钮,它会将您注销,我也会向根视图控制器执行popToViewController,您可以使用您的Facebook帐户再次访问或者我原来的应用计数系统。
这是使用FBSDK登录委托方法完成的:loginButtonDidLogOut
问题是,在使用FB在应用程序中登录后,然后完全关闭应用程序(终止它),然后再次打开应用程序(立即使用您的Facebook帐户登录),它不会单击应用程序内的注销按钮后执行popToViewController。 我不知道为什么。
也许它与令牌过期的idk有关。
这是我声明第二个FBSDKLoginButton的地方(因此用户可以稍后在应用程序中注销):
FBSDKLoginButton *fbButton = [[FBSDKLoginButton alloc] initWithFrame:CGRectMake(0, 0, thisCell.frame.size.width, thisCell.frame.size.height)];
[fbButton setBackgroundImage:nil forState:UIControlStateNormal];
[thisCell addSubview:fbButton];
[thisCell bringSubviewToFront:fbButton];
[fbButton setDelegate:self];
(注销按钮位于UICell内,位于UITableView中) (上面的代码在我的cellForRowAtIndexPath方法中)
这是我拥有的FBSDK委托方法:
- (void)loginButton:(FBSDKLoginButton *)loginButton didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result error:(NSError *)error{
}
- (void)loginButtonDidLogOut:(FBSDKLoginButton *)loginButton{
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:0] animated:YES];
}
它可能是什么?我的猜测是代表方法在我成功之后不会被调用#34;退出我的FB帐户。
请记住,这只有在我使用FB帐户登录时终止应用程序然后尝试在应用程序中关闭它时才会发生。