ios facebook sdk 4.0 login error code 304

后端 未结 14 1908
死守一世寂寞
死守一世寂寞 2020-12-08 01:36

I\'ve just updated facebook sdk v4.0

and according the tutorial of Using Custom Login UIs

-(IBAction)facebookLoginClick:(id)sender {

FBSDKLoginManag         


        
14条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 02:24

    Swift 3.0

    func loginWithFacebook
    {
            let loginManager = FBSDKLoginManager()
            if let currentAccessToken = FBSDKAccessToken.current(), currentAccessToken.appID != FBSDKSettings.appID()
            {
                loginManager.logOut()
            }
    
            loginManager.logIn(withReadPermissions: ["public_profile","email"], from: self, handler: { (result, error) in
                if error != nil {
                    print("error\(String(describing: error))")
                }
                else if (result?.isCancelled)! {
                }
                else {
                    print(FBSDKAccessToken.current())
                }
            })
    }
    

提交回复
热议问题