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.
-
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?
-
Signs-in a user through
Sign-in With Apple
feature available in iOS 13 and aboveDeclaration
Swift
public func signIn(idpClient: IdPClient, completion: @escaping SocialLoginCompletionCallback)
Parameters
idpClient
IdPClient
informationcompletion
Completion callback to notify the result
-
Generates, and returns
UIView
forSign-in With Apple
buttonDeclaration
Swift
public func getProviderButtonView() -> UIView?
Return Value
Sign-in With Apple
button inUIView
-
Generates, and returns
UIView
forSign-in With Apple
button withButtonType
, andStyle
optionsDeclaration
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 inUIView
-
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