我正在尝试使用 SwiftUI 实现 Sign in With Apple,但在我输入正确的密码后它挂起。
我使用的是真实用户、模拟器和 XCode 12.0 Beta。不幸的是,我现在没有可用的设备进行测试。我也尝试过沙盒用户,但没有成功。
我已将使用 Apple 登录功能添加到配置文件中
从未达到成功的打印声明。
我错过了什么?
使用来自https://developer.apple.com/documentation/swiftui/signinwithapplebutton的示例代码
import SwiftUI
import AuthenticationServices
struct SignInView: View {
var body: some View {
VStack {
SignInWithAppleButton(
.signIn,
onRequest: { request in
request.requestedScopes = [.fullName]
},
onCompletion: { result in
switch result {
case .success (let authResults):
print("rhe01 Authorization successful.")
case .failure (let error):
print("rhe01 Authorization failed: " + error.localizedDescription)
}
}
)
}
}
}
