使用未调用的 Apple ASAuthorizationControllerDelegate 方法登录

Kex*_*Kex 6 ios swift asauthorizationcontroller

我正在尝试为 iOS13“使用 Apple 登录”功能准备我的应用程序。我已经实现了这些ASAuthorizationControllerDelegate方法并设置了我ASAuthorizationController的委托。当我点击使用 Apple 按钮登录时,输入密码后没有任何反应。密码是正确的(我知道这是因为不正确时字段会抖动),但是没有任何反应。登录对话框不会关闭,也不会调用代表。

    @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()
    }
Run Code Online (Sandbox Code Playgroud)

还有其他人有这个问题吗?

Kex*_*Kex 2

在这里回答我自己的问题。需要访问developer.apple.com并导航至Certificates, Identifiers & Profiles。然后在“标识符”下选择相关的应用程序 ID,然后添加“使用 Apple 登录”功能。请注意,您必须为您编辑的应用程序 ID 重新生成配置文件。