sendMessage

open fun sendMessage(    @Nullable message: String,     @Nullable attachment: BaseAttachment,     @NonNull conversationId: String,     isRequireAcknowledgement: Boolean,     bearer: Int,     @Nullable completion: CompletionCallback)

Call this method to send a new message/attachment for an existing conversation.

This method does not create a new conversation if not exist

This method does not allow :

  • an empty message without attachment
  • a none existing conversation

If an attachment exists, this method will attempt to upload it, and if successful, the message will be added to the request queue.

An event IConversationObservable will be delegated when the message is successfully sent or failed.

See also

Parameters

message

Message content text

attachment

Attachment model

conversationId

The identifier of the current conversation.

isRequireAcknowledgement

If true the message required an acknowledgement from recipients

bearer

Whether this message is sent automatically using an NFC Tag or not.

completion

This callback will be invoked to handle operation result :

  • Success : The message is successfully added to the sending queue.
  • Error : a local error occurred when trying to send message

open fun sendMessage(    @Nullable message: String,     @Nullable attachment: BaseAttachment,     @NonNull recipients: Array<String>,     conversationType: Int,     @Nullable conversationName: String,     isAvailableOnlyRecipients: Boolean,     isRequireAcknowledgement: Boolean,     bearer: Int,     @Nullable completion: CompletionCallback)

Call this method to send a new message/attachment

A new conversation will be created based on the users, groups and the conversationType parameters. If the message is going to be send to a single recipient (users = 1), the message will be created in a OneToOne conversation if it is already exist otherwise a new conversation will be created.

If an attachment exists, this method will attempt to upload it, and if successful, the message will be added to the request queue.

An event IConversationObservable will be delegated when the message is successfully sent or failed.

See also

Parameters

message

Message content text

attachment

Attachment model

recipients

The list of international phone numbers and/or list of groups that you want to send a message (example of users format: [group:1,group:2,1234567891,1234567892,1234567893])

conversationType

Conversation type

conversationName

Conversation name in case of conversationType is THREAD_TYPE_GROUP or THREAD_TYPE_ONE_TO_MANY type

isAvailableOnlyRecipients

If the messages will be sent only to the available recipients.

isRequireAcknowledgement

If the message require acknowledgement

bearer

Whether this message is sent automatically using an NFC Tag or not.

completion

This callback will be invoked to handle operation result :

  • Success : The message is successfully added to the sending queue.
  • Error : a local error occurred when trying to send message