AppleSignInHandler

public class AppleSignInHandler : NSObject, IdPHandler
extension AppleSignInHandler: ASAuthorizationControllerDelegate
extension AppleSignInHandler: ASAuthorizationControllerPresentationContextProviding

AppleSignInHandler is responsible to perform authorization/signing-in a user using Apple ID, and AuthenticationServices framework; Sign-in With Apple is only available for iOS 13 and above.

Properties

  • Token type for Sign-in With Apple; id_token

    Declaration

    Swift

    public var tokenType: String
  • Currently displayed UIViewController in the application

    Declaration

    Swift

    public var presentingViewController: UIViewController?

Protocol

  • Signs-in a user through Sign-in With Apple feature available in iOS 13 and above

    Declaration

    Swift

    public func signIn(idpClient: IdPClient, completion: @escaping SocialLoginCompletionCallback)

    Parameters

    idpClient

    IdPClient information

    completion

    Completion callback to notify the result

  • Generates, and returns UIView for Sign-in With Apple button

    Declaration

    Swift

    public func getProviderButtonView() -> UIView?

    Return Value

    Sign-in With Apple button in UIView

  • Generates, and returns UIView for Sign-in With Apple button with ButtonType, and Style options

    Declaration

    Swift

    @available(iOS 13.0, *)
    public func getAppleButtonView(buttonType: ASAuthorizationAppleIDButton.ButtonType = .signIn, style: ASAuthorizationAppleIDButton.Style = .black) -> UIView?

    Parameters

    buttonType

    ASAuthorizationAppleIDButton.ButtonType option; default value with .signIn

    style

    ASAuthorizationAppleIDButton.Style option; default value with .dark

    Return Value

    Sign-in With Apple button in UIView

  • Declaration

    Swift

    @MainActor
    public func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization)
  • Declaration

    Swift

    @MainActor
    public func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error)
  • Declaration

    Swift

    @MainActor
    public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor
  • Declaration

    Swift

    public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor