每当Google返回" finishedWithAuth" userID变量始终为nil
这是我的代码
override func viewDidLoad() {
super.viewDidLoad()
// Configure the Google+ Sign In
var signIn = GPPSignIn.sharedInstance()
signIn.scopes = ["profile"];
signIn.shouldFetchGooglePlusUser = true
signIn.clientID = kClientId
signIn.shouldFetchGoogleUserEmail = true
signIn.shouldFetchGoogleUserID = true
signIn.trySilentAuthentication()
signIn.delegate = self
}
func finishedWithAuth(auth: GTMOAuth2Authentication!, error: NSError!) {
if(error == nil && auth != nil){
println(auth.userID) // always nil
println(auth.userEmail) // always contains user's email
}else{
println("Recieved error \(error) and auth object \(auth)")
}
}
我无法看到我做错了什么