Created
March 21, 2020 02:49
-
-
Save MaatheusGois/3724813c9db292aae7abc3e60fc9a348 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ViewController: ASAuthorizationControllerDelegate { // 1 | |
//2 | |
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { | |
if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential { | |
let userIdentifier = appleIDCredential.user | |
let fullName = appleIDCredential.fullName | |
let email = appleIDCredential.email | |
print("User id is \(userIdentifier) \n Full Name is \(String(describing: fullName)) \n Email id is \(String(describing: email))") } | |
} | |
//3 | |
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) { | |
print(error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment