Slide 17
Slide 17 text
Authentication(Firebase)
// google account sign in
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) {
if let error = error {
print("Error \(error)")
return
}
guard let authentication = user.authentication else { return }
let credential = FIRGoogleAuthProvider.credential(withIDToken: authentication.idToken,
accessToken: authentication.accessToken)
FIRAuth.auth()?.signIn(with: credential) { (user, error) in
if let error = error {
print("Error \(error)")
return
}
}
}