Facebook Войти на другую страницу - PullRequest
0 голосов
/ 12 ноября 2018

Я хочу перейти на Dashboard после входа в FB SDK. и я могу войти в систему и уже вошли. но я не могу перейти на панель инструментов. в чем проблема?

Большое спасибо

класс ViewController: UIViewController, FBSDKLoginButtonDelegate {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    // login button

    let loginButton = FBSDKLoginButton()
    view.addSubview(loginButton)

    loginButton.frame = CGRect(x: 16, y: 500, width: view.frame.width - 40, height: 50)

    // getting login status back

    loginButton.delegate = self

    // if login then head to dashboard

    if FBSDKAccessToken.current() == nil {
        // User is not already logged
        print("No Logged")
    } else {
        // User is already logged
        fetchProfile()
        print("Already Logged")
    }
}

func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
    if error != nil {
        print(error)
        return
    }
    // jump to Dashboard

    performSegue(withIdentifier: "goToDashboard", sender: self)
    print("logged in")
}

func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
    print("logged out")
}

}

1 Ответ

0 голосов
/ 13 ноября 2018

executeSeague здесь не работает.

это другой метод, который я использую

func jumpToDashboard() {
    let next = storyboard?.instantiateViewController(withIdentifier: "Dashboard")
    self.present(next!, animated: true, completion: nil)
}
...