I am trying to login through the Facebook SDK login system in viewWillAppearlike this:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if !loggedIn {
if let token = FBSDKAccessToken.current() {
loggedIn = true
self.accessToken = token
} else {
let login = FBSDKLoginButton()
login.center = view.center
view.addSubview(login)
}
}
}
This one works on a real device, but lately on the iOS 10 simulator, using Xcode 8 and Swift 3, it seems like it doesn't work. The login button works fine and requests a login and authorization page, but after authorization / login, the token ( FBSDKAccessToken.current()) remains nil.
Again, the problem only applies to the simulator using iOS 10, Xcode 8, and Swift 3.
What could be the problem and how can I make it work on the simulator? Thanks in advance.
Eilon