Facebook SDK Login not working on simulator on iOS 10, Xcode 8

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.

+4
1

, , SDK Facebook. iOS 10 :
Project Target, Capabilities .
. , .

enter image description here

+18

Source: https://habr.com/ru/post/1656319/


All Articles