我一直在尝试为 iOS 和 tvOS 应用程序实现 Apple ID 登录。iOS 可以很好地使用 Apple ID 登录,但是每当我尝试通过我们的 tvOS 应用程序登录时,它都会在 UI 中显示一个通用的未知错误(错误 1000),并且在调试日志中,它会给我以下错误:
[核心] 授权失败:错误域=AKAuthenticationError Code=-7014 "(null)" UserInfo={AKClientBundleID=[bundleID]}
我使用下面的代码,遵循 Apple ID 登录的基本步骤:
@IBAction func signInbuttonTapped(_ sender: Any) {
let appleIDProvider = ASAuthorizationAppleIDProvider()
let request = appleIDProvider.createRequest()
request.requestedScopes = [.fullName, .email]
let authorizationController = ASAuthorizationController(authorizationRequests: [request])
authorizationController.delegate = self
authorizationController.presentationContextProvider = self
authorizationController.performRequests()
}
我在 XCode 中打开了“使用 Apple 登录”功能,并且我们的 tvOS 应用程序标识符使用与 iOS 标识符相同的组应用程序 ID,因此看起来没问题。没有任何论坛给出这个确切的错误。有谁知道错误代码 -7104 是什么意思,我能做些什么来解决它?谢谢你。