Last active
March 21, 2020 04:00
-
-
Save MaatheusGois/0a4b0bd27a2cb04f442baa24cf6c3db3 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 | |
func authorizationController(controller: ASAuthorizationController, | |
didCompleteWithAuthorization | |
authorization: ASAuthorization) { | |
//1.1 | |
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))") | |
} | |
} | |
//2 | |
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