简体   繁体   English

无法使用iOS 10上的Facebook登录登录

[英]Can't login using Facebook Login on iOS 10

I'm having a problem with Facebook login on the latest version of iOS 10 and the latest Facebook SDK using Cocoapods. 我在使用Cocoapods的最新版iOS 10和最新的Facebook SDK上登录Facebook时遇到问题。 This was working fine, and now it's not working. 这工作正常,现在它不起作用。 When I come back from logging in the access token is nil. 当我从登录回来时,访问令牌是零。 It wasn't nil before. 以前不是零。 I do see a message in my log. 我确实在日志中看到了一条消息。 I Googled the error and could not find anything. 我用Google搜索错误,但找不到任何内容。 I have followed the instructions in the Facebook developer login guide. 我已按照Facebook开发人员登录指南中的说明进行操作。

2016-11-04 10:10:26.122435 Ghosts[833:83731] FBSDKLog: Invalid identifier: 'fb_mobile_login_native_app_switch_dialog_result'. 2016-11-04 10:10:26.122435 Ghosts [833:83731] FBSDKLog:标识符无效:'fb_mobile_login_native_app_switch_dialog_result'。 Must be between 1 and 40 characters, and must be contain only alphanumerics, _, - or spaces, starting with alphanumeric or _.``` 必须介于1到40个字符之间,并且必须仅包含字母数字,_, - 或空格,以字母数字或_``开头

if ([FBSDKAccessToken currentAccessToken]) {
}

FBSDKCoreKit 4.17.0 FBSDKCoreKit 4.17.0

iOS 10.1.1 iOS 10.1.1

Xcode 8.1 Xcode 8.1

Objective-C with ARC Objective-C with ARC

It turns out that the access token can be nil immediately after. 事实证明,访问令牌可以在之后立即为零。 You have to wait for a notification before it can be used. 您必须先等待通知才能使用它。 I think this is a new requirement. 我认为这是一项新要求。

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkLogIn) name: FBSDKAccessTokenDidChangeNotification object:nil];

.

That other error message was just a warning I think. 我想其他错误信息只是一个警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM