-
Simplify sign in for your tvOS apps
Find out how people can use Face ID or Touch ID on their iOS or iPadOS device to authorize purchases and sign into your tvOS app. Discover how you can simplify sign in for people using your app and help them get to the content they want to enjoy, faster. We'll show you how to set up a simplified sign in process and share some best practices about creating great sign in experiences for Apple TV.
To get the most out of this session, we recommend a basic understanding of associated domains and the Authentication Services framework.Recursos
Vídeos relacionados
WWDC22
WWDC21
-
Buscar neste vídeo...
-
-
3:28 - Request a credential
let controller = ASAuthorizationController(authorizationRequests: [ ASAuthorizationPasswordProvider().createRequest() ]) controller.delegate = self controller.performRequests() -
4:19 - Finish signing in
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) { if let credential = authorization.credential as? ASPasswordCredential { // Use the credential to sign in } } -
4:43 - Handle errors
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) { if case ASAuthorizationError.canceled = error { return } // Let the user know something went wrong } -
6:00 - Specify custom authorization methods
controller.customAuthorizationMethods = [ // Sign in Manually .other, // Restore Purchase .restorePurchase ]
-