self.logInButton = FBSDKLoginButton()
self.logInButton.loginBehavior = FBSDKLoginBehavior.Native
//Above Uses Facebook iOS setting
//login if User is logged in from their device setting
if FBSDKAccessToken.currentAccessToken() == nil{
//User is not logged in
} else {
//User is logged in
}
如果发生任何这种情况,我需要找到一种方法。我想知道Facebook SDK是否注册了某种通知,以了解登录状态是否已更改。
FBSDKLoginButtonDelegate会触发" loginButtonDidLogOut"如果有人从Facebook注销而不是从我的应用程序注销?
答案 0 :(得分:0)
是。使用Facebook登录委托方法。
这是Objective-C但方法调用应该类似: - (void)loginButtonDidLogOut:(FBSDKLoginButton *)loginButton;
https://developers.facebook.com/docs/reference/ios/current/protocol/FBSDKLoginButtonDelegate