Information about a message managed by your app.


class INMessage : NSObject


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, when the current device user sends 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.


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.

var serviceName: String?

The service used to send the message.


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.