tvOS Support

Digits Authentication on Apple TV

Digits for Apple TV lets people create an account or sign into your app without having to enter a phone number or confirmation code into the TV itself. Instead, the Apple TV will display a code to the user that they can enter on https://digits.com/appletv.

Digits knows which user is entering the code because this website is behind a secure Digits web login. Meanwhile, Digits on Apple TV is polling our servers waiting for the user to enter the code. On completion, your app’s callback will be called with the user’s session.

Set up Digits Authentication

Use the DGTAssistedAuthViewController to kick off Digits authentication on Apple TV. You can present this view controller however you like: modally, in a navigation controller, etc. A pincode will be fetched and displayed to your users as soon as you display the view controller. No additional work required.

// Objective-C
- (void)didTapButton {
    DGTAssistedAuthViewController *viewController = [[DGTAssistedAuthViewController alloc] initWithAppearance:nil completionBlock:^(DGTSession *session, NSError *error) {
      // Inspect session/error objects
    }];

    [self presentViewController:viewController animated:YES completion:nil];
}
// Swift
func didTapButton(sender: AnyObject) {
    let viewController = DGTAssistedAuthViewController(appearance: nil) { session, error in
      // Inspect session/error objects
    }

    presentViewController(viewController, animated: true, completion: nil)
}

Note

Note that a current limitation is that each instance can only be used once. If you need subsequent Digits logins, create new instances of DGTAssistedAuthViewController.

The Digits for Apple TV screen looks like:

../_images/digits_tv.png