Contents

init(identifier:conversationIdentifier:content:dateSent:sender:recipients:messageType:)

Creates a message of a distinct type with the specified content.

Declaration

convenience init(identifier: String, conversationIdentifier: String?, content: String?, dateSent: Date?, sender: INPerson?, recipients: [INPerson]?, messageType: INMessageType)

Parameters

  • identifier:

    The message’s unique identifier. Specify a value that you can later use to identify the same message.

  • conversationIdentifier:

    The identifier of the conversation that contains this message.

  • content:

    The text that Siri recites to the message recipient.

  • dateSent:

    The date and time the app sent the message to each recipient.

  • sender:

    The person who sent the message.

  • recipients:

    The people who recieved the message.

  • messageType:

    The type of content the message contains. For possible values, see Inmessagetype.

Return Value

A message that SiriKit configures with the specified parameters, or nil if there was a problem creating the message.

Discussion

Use the conversationIdentifier parameter to associate individual messages with a larger discussion among a specific group of people.

For each participant in the message (sender and recipients), create an instance of INPerson using one of the initializers that require an isMe parameter. Use true for the participant that represents the user of the current device; for all other participants, use false. When creating each of those objects, provide enough information for you to later identify that same person.

See Also

Creating a Message