Class

INPerson

The information about a user involved in a SiriKit interaction.

Declaration

@interface INPerson : NSObject

Overview

SiriKit uses INPerson objects to represent users with many different roles, including the sender or recipient of calls and messages, the payer or payee of a financial transaction, or the driver of a vehicle. You also use person objects to identify the corresponding user in your app and to communicate information about that user back to SiriKit.

When resolving the parameters of an intent, use any provided INPerson objects to identify the corresponding users in your app. A person object contains information provided by the initial request, which could be as little as a single name spoken by the user. (If the customIdentifier property has a value, you can use it to retrieve additional information from the Contacts database). After identifying the user, create a new INPerson object and fill it with the information that you need to identify the user again later. For example, you might specify a value for personHandle property that contains the information about how your app identifies the user.

When resolving the identities of people, SiriKit leverages the information in the user’s contacts database when that information is available. If the user denies your app access to their contacts, SiriKit can’t use that information, which might cause many properties of a person object to be nil. Because the INPerson class conforms to the INSpeakable protocol, though, SiriKit still populates the spokenPhrase property with what the user said, and you can use that information to try to identify the user. For more information about that protocol, see INSpeakable.

Topics

Initializing a Person Object

- initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:

Initializes a person object with the specified name and contact information.

- initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:

Initializes a person object with the specified name, contact information, and flag indicating whether the person is the current device user.

- initWithHandle:displayName:contactIdentifier:

Initializes a person object with the specified display name and contact information.

Deprecated
- initWithHandle:nameComponents:contactIdentifier:

Initializes a person object with the specified display name and contact information.

Deprecated
- initWithHandle:nameComponents:displayName:image:contactIdentifier:

Initializes a person object with the specified name and contact information.

Deprecated

Getting the User's Name

displayName

The formatted name of the user.

nameComponents

The actual name of the user specified as a set of name components.

Getting Identifiying Information

personHandle

The unique handle that your app assigned to the user.

image

An image of the person.

isMe

A Boolean value indicating whether the person is the current user of the device.

aliases

An array of alternate identifiers for the user.

handle

The unique identifier that your app assigned to the user.

Deprecated

Getting Person-Related Identifiers

contactIdentifier

The identifier associated with a user record in the Contacts database.

customIdentifier

The custom identification string that your app uses to identify the user.

Getting Other Information

suggestionType

The type of contact information to donate with interactions.

INPersonSuggestionType

Constants indicating how to display the person’s identity.

Identifiying a Person by Relationship

relationship

The relationship of this person to the current user.

INPersonRelationship

Constants indicating the relationship between the current user and another person.

Getting Matching Persons

siriMatches

A list of possible matches suggested by Siri.

Relationships

Inherits From

See Also

Contacts

INPersonHandle

The identifying information for a user of your app.

INPersonHandleLabel

Constants describing how the person handle relates to the user.