Sign in with Apple ASAuthorizationControllerDelegate methods not called

4.5k Views Asked by At

I am trying to prepare my app for the iOS13 "Sign in with Apple" feature. I have implemented the ASAuthorizationControllerDelegate methods and set my ASAuthorizationController's delegate. When I tap the sign in with Apple button, after I enter the password there is no response. The password is correct (I know this because the field shakes when incorrect), however nothing happens. The sign in dialog doesn't dismiss and the delegates aren't called.

    @available(iOS 13.0, *)
    @objc private func didTapAppleButton() {
        let request = ASAuthorizationAppleIDProvider().createRequest()
        request.requestedScopes = [.fullName, .email]
        let vc = ASAuthorizationController(authorizationRequests: [request])
        vc.presentationContextProvider = self
        vc.delegate = self
        vc.performRequests()
    }

Does anyone else have this issue?

4

There are 4 best solutions below

0
Kex On

Answering my own question here. Need to go to developer.apple.com and navigate to Certificates, Identifiers & Profiles. Then under Identifiers choose the relevant app id and then add the Sign In with Apple capability. Note that you will have to regenerate the provisioning profiles for the app ids you edit.

2
Sergey Sergeyev On

Do you allocated the code into a separate class so that your ViewController does not look like a trash heap? And you applied good practice principles to SOLID software development? Apl says - In vain XD!

Only ViewController can be a delegate.

It looks like a bug, alas.

0
Krishna Raj Salim On

Go to Apple Developer Account > Add 'Sign In with Apple' Capability to your app id (also make sure you've enabled it in Xcode too):

enter image description here

Keep Coding........ :)

0
Mrugesh Tank On

While following SOLID principal, AppleAuth class' reference must be alive when ASAuthorizationControllerDelegate is being called.
i.e. make your single responsibility class' object with viewController scope, not only method level scope.