Skip to content

Message

Sends a message.

Presents UI for sending a message.

recipients

Recipients of the message.

Array of recipients to send the message to. Elements in the array should be phone numbers. You will have a chance to modify this before the message is sent.

recipients: [string]

body

Body of the message.

Body of the message to send.\You will have a chance to modify this before the message is sent.

body: string

-new Message

Constructs a message.

Constructs a message to be sent either as a text message or an iMessage.

new Message()

-send

Send the message.

Presents a screen from which the message can be sent. The message will not be sent until you have confirmed it from the presented screen.

send()

-addImageAttachment

Adds an image attachment to the message.

addImageAttachment(image: Image)

-addFileAttachment

Adds a file attachment to the message.

addFileAttachment(filePath: string)

-addDataAttachment

Adds a data attachment to the message.

When adding a data attachment to the message, you are responsible for providing a valid Uniform Type Identifier and filename. It is advised to use addImageAttachment and addFileAttachment whenever possible.

addDataAttachment(data: Data, uti: string, filename: string)