Class

TVUserManager

An object for mapping Apple TV user accounts to app-specific user preferences.

Declaration

class TVUserManager : NSObject

Overview

A TVUserManager object improves the user experience of apps that manage their own user-specific preferences. At launch time, many apps prompt the user to select an app-specific profile. For example, video content apps use profiles to store information about which shows each user is watching and their current progress for each show. However, requiring the user to select a profile every time your app launches is cumbersome, especially for systems with only one user. The TVUserManager object provides a way for your app to select the most appropriate user profile automatically.

Create the TVUserManager object as follows:

let userManager = TVUserManager()

When your app launches, get the currentUserIdentifier property of the user manager and use it to select an appropriate app-specific profile. You are responsible for maintaining a mapping between system users and your app's configured profiles. If the current system user doesn't have a preferred profile, display your normal profile selection interface. The first time the user selects a profile, call the shouldStorePreferenceForCurrentUser(to:completion:) method to confirm whether the user wants to make that profile their preferred profile.

Apps should provide a way for users to change their preferred profile. When the user wants to make such a change, call the presentProfilePreferencePanel(currentSettings:availableProfiles:completion:) method to display the standard configuration panel.

Topics

Identifying the Current Apple TV User

var currentUserIdentifier: TVUserIdentifier?

A unique identifier representing the currently active Apple TV user.

typealias TVUserIdentifier

A unique string for differentiating between accounts on Apple TV.

Presenting Account-Related Dialogs

Associating Users with a Profile

var userIdentifiersForCurrentProfile: [TVUserIdentifier]

An array of system user identifiers that you associated with the current app-specific profile.

Responding to Changes in User

class let currentUserIdentifierDidChangeNotification: NSNotification.Name

Posted after the current user identifier changes.

Relationships

Inherits From

Conforms To

See Also

Multiple User Login

class TVAppProfileDescriptor

A model object that you use to represent an app-specific profile.

Mapping Apple TV Users to App Profiles

Adapt the content of your app for the current viewer by using TV user manager.