Skip to content

Instantly share code, notes, and snippets.

@MaatheusGois
Created March 21, 2020 02:49
Show Gist options
  • Save MaatheusGois/3724813c9db292aae7abc3e60fc9a348 to your computer and use it in GitHub Desktop.
Save MaatheusGois/3724813c9db292aae7abc3e60fc9a348 to your computer and use it in GitHub Desktop.
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