gpt4 book ai didi

ios - Facebook 登录按钮在登录后不会立即更改为注销按钮

转载 作者:行者123 更新时间:2023-11-30 11:04:34 26 4
gpt4 key购买 nike

我正在使用 FacebookSDKs-iOS-20160316 进行 Xcode 9.2 Swift 4.0 的 Facebook 登录身份验证集成。我的 Storyboard是空的。

运行时

应用程序上出现 Facebook 登录按钮

点击Facebook登录页面,登录成功后出现

询问我的应用程序的权限,当允许时出现以下页面

Page after allowing access to my app

当我点击此页面的完成按钮时

我被重定向到我的 Storyboard,这次也有相同的登录按钮,我的登录按钮没有更改为注销。再次点击,出现以下页面:
After clicking Login button again这种事每次都会发生。请帮助我。

我尝试过的事情:

重新启动模拟器

重新启动 Xcode

更改了模拟器

//My View Controller is having code:

class ViewController: UIViewController,FBSDKLoginButtonDelegate{

func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWithresult:
FBSDKLoginManagerLoginResult!, error: Error!)
{
print("Logged in")
}
func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!)
{
print("Logged out")
}

let loginManager: FBSDKLoginManager = FBSDKLoginManager()
override func viewDidLoad()
{
super.viewDidLoad()
let button = FBSDKLoginButton()
button.center = self.view.center
self.view.addSubview(button)
button.delegate = self
}
}

最佳答案

尝试使用此功能来注销和登录。

func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
print("User is looged out")
}

关于ios - Facebook 登录按钮在登录后不会立即更改为注销按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52867810/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com