swift 开发 sign in with apple

发布时间:2022-06-21 23:01:27

现在的ios app上架,有三方登录的 还得把sign in with apple得带上, 不然不能上架

In iOS 13 at WWDC 2019, Apple introduce a fast, easy way to sign in to apps and websites i.e. Sign In with Apple. This repository contains the complete working demo for Sign In with Apple.

github上的demo

https://github.com/developerinsider/Sign-In-with-Apple-Demo

这个示例在我使用的时候报错

the operation couldn't be completed. no credentials available for login

可以在使用下面的方法时,去掉ASAuthorizationPasswordProvider

   private func performExistingAccountSetupFlows() {
           // Prepare requests for both Apple ID and password providers.
//           let requests = [ASAuthorizationAppleIDProvider().createRequest(), ASAuthorizationPasswordProvider().createRequest()] //如果使用密码授权会报错
           let requests = [ASAuthorizationAppleIDProvider().createRequest()]

           // Create an authorization controller with the given requests.
           let authorizationController = ASAuthorizationController(authorizationRequests: requests)
           authorizationController.delegate = self
           authorizationController.presentationContextProvider = self
           authorizationController.performRequests()
       }

Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为