Sign in with Apple: Error: Sign-Up Not Completed

Sign in with Apple: Error: Sign-Up Not Completed

使用apple id登录,配置所有需要的人员。

在开发者帐户中启用 Apple 登录。

代码:

import UIKit
import AuthenticationServices

class ViewController: UIViewController, ASAuthorizationControllerDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let button = ASAuthorizationAppleIDButton()
        button.addTarget(self, action: #selector(appleIDButtonPressed), for: .touchUpInside)
        button.center = view.center
        view.addSubview(button)
    }
    
    @objc private func appleIDButtonPressed() {
        let appleIDProvider = ASAuthorizationAppleIDProvider()
        let request = appleIDProvider.createRequest()
        request.requestedScopes = [.fullName, .email]
        let authorizationController = ASAuthorizationController(authorizationRequests: [request])
        authorizationController.delegate = self
        authorizationController.performRequests()
    }
    
    func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
        
    }
    
    func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
        
    }
}

点击登录按钮并验证人脸时显示 UI 错误,但未调用委托。

image of UI error

这是 Apple 方面的问题,我昨天尝试了所有方法都没有用,现在它可以用了。 :)