Class

INMessage

Information about a message managed by your app.

Declaration

class INMessage : NSObject

Overview

An INMessage object conveys information about your app’s messages to Siri. You create message objects as part of your response to an INSearchForMessagesIntent object. Message objects contain the unique message identifier and additional information such as the message contents, sender, and recipients.

When creating the INPerson object for the sender or recipients, use the init(personHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:) method, and set the isMe parameter to true when the person is the user of the device. For example, if the current device user is sending an outgoing message, set isMe to true. Similarly, when creating the recipient array for an incoming message—which should include the current device user—set isMe to true for the person in the recipient list that is the device user, and set the parameter to false for the other recipients.

Topics

Identifying the Message

var identifier: String

The app-specific unique identifier for the message.

var conversationIdentifier: String?

The identifier associated with the conversation.

Getting the Message Attributes

var messageType: INMessageType

The type of content contained in the message.

enum INMessageType

Constants indicating the type of content contained in a message.

var sender: INPerson?

The user that sent the message.

var recipients: [INPerson]?

The users that received the message.

var groupName: INSpeakableString?

The name of the group associated with the message.

var content: String?

The content of the message.

var dateSent: Date?

The date the sender sent the message.

Relationships

Inherits From

See Also

Data Objects

enum INMessageAttribute

Constants indicating an attribute of a message.

struct INMessageAttributeOptions

Constants indicating the status of a message.

class INPerson

The information about a user involved in a SiriKit interaction.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software