Contents

sendMessage(_:to:using:messageID:)

Sends a file transfer message to a specified destination.

Declaration

final func sendMessage(_ content: RCSMessage.FileTransfer, to destination: RCSHandle, using cellularServiceID: CellularServiceID, messageID: RCSMessageID) async throws

Parameters

  • content:

    The content of the message to send, as an instance of Filetransfer.

  • destination:

    The destination handle to send the message to.

  • cellularServiceID:

    The service identifier to use for the message.

  • messageID:

    The message identifier to use for the message.

Discussion

Use this version of the sendMessage method in combination with the upload(_:) and download(_:) methods of RCSService.

To send a file to a recipient, call the upload method and use the returned metadata to create a new RCSMessage with content that’s an instance of RCSMessage.FileTransfer.

To receive a file, start by iterating over items in the incomingMessageNotifications asynchronous sequence. When you get a message with a content value that’s RCSMessage.Content.fileTransfer(_:), use the file URL and other metadata in the associated RCSMessage.FileTransfer value to call the download method.

See Also

Sending messages