iOS:Facebook Access令牌为零

时间:2016-10-29 02:49:19

标签: ios swift facebook facebook-access-token

为什么即使在测试用户登录后,viewdidload中的Facebook访问令牌也为零?

override func viewDidLoad() {
    super.viewDidLoad()
let loginButton = FBSDKLoginButton()
    loginButton.center = self.view.center
    self.view.addSubview(loginButton)
    loginButton.readPermissions = ["public_profile", "email", "user_friends"]

    if (FBSDKAccessToken.current() != nil) {
        // User is logged in, do work such as go to next view controller.
        let vc = MainViewController()
        self.present(vc, animated: true, completion: nil)
    }
}

0 个答案:

没有答案