Contents

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

Creates a message with the specified content.

Declaration

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

Parameters

  • identifier:

    The message’s unique identifier. Specify a value that you can later use to identify the same 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.

Return Value

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

Discussion

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