Example #1
0
 public void DidComplete(ASAuthorizationController controller, ASAuthorization authorization)
 {
     // Determine whether the user authenticated via Apple ID or a stored iCloud password.
     if (authorization.GetCredential <ASAuthorizationAppleIdCredential>() is { } appleIdCredential)
     {
         CompletedWithAppleId?.Invoke(controller, appleIdCredential);
     }
Example #2
0
        protected override Task RegisterNewAccount(ASAuthorizationAppleIdCredential appleIdCredential)
        {
            var credential = Map(appleIdCredential);

            _sessionManager.CreateUserIdentifier(credential);

            // TODO: Make a call to your service and signify to the caller whether registration succeeded or not.

            CompletedWithAppleId?.Invoke(this, credential);

            return(Task.CompletedTask);
        }
Example #3
0
        protected override Task SignInWithExistingAccount(ASAuthorizationAppleIdCredential appleIdCredential)
        {
            var credential = Map(appleIdCredential);

            // You *should* have a fully registered account here.  If you get back an error
            // from your server that the account doesn't exist, you can look in the keychain
            // for the credentials and rerun setup

            // if (WebAPI.login(credential.user,
            //                  credential.identityToken,
            //                  credential.authorizationCode)) {
            //   ...
            // }

            CompletedWithAppleId?.Invoke(this, credential);

            return(Task.CompletedTask);
        }