Message
Sends a message.
Presents UI for sending a message.
Properties
Section titled “Properties”Body of the message.
body: stringBody of the message to send. You will have a chance to modify this before the message is sent.
recipients
Section titled “recipients”Recipients of the message.
recipients: [string]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.
Methods
Section titled “Methods”
new Message()
Section titled “new Message()”Constructs a message.
new Message()Constructs a message to be sent either as a text message or an iMessage.
addDataAttachment(data, uti, filename)
Section titled “addDataAttachment(data, uti, filename)”Adds a data attachment to the message.
addDataAttachment(data: Data, uti: string, filename: string)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.
Parameters
Section titled “Parameters”data Data
Data representation of file to add to the message.
uti string
UTI of file represented by the data.
filename string
Name of the file represented by the data.
addFileAttachment(filePath)
Section titled “addFileAttachment(filePath)”Adds a file attachment to the message.
addFileAttachment(filePath: string)Parameters
Section titled “Parameters”filePath string
Path of file to add to the message.
addImageAttachment(image)
Section titled “addImageAttachment(image)”Adds an image attachment to the message.
addImageAttachment(image: Image)Parameters
Section titled “Parameters”image Image
Image to add to the message.
send()
Section titled “send()”Send the message.
send(): PromisePresents a screen from which the message can be sent. The message will not be sent until you have confirmed it from the presented screen.
Return value
Section titled “Return value”Promise
Promise that is fulfilled when the message have been sent.