handleDraftMessage

open fun handleDraftMessage(    @NonNull context: Context,     @Nullable conversationID: String,     @Nullable text: String,     @Nullable attachment: BaseAttachment,     isAvailableOnlyRecipients: Boolean,     @Nullable recipients: Array<String>,     bearer: Int,     @Nullable callback: CompletionCallback)

Call this method to add, update or remove drafts in conversations from local database.

This method will create a new conversation and a new draft message if conversation ID is null, based on the users and groups parameters. A one to one conversation will be created if there is only one single recipient, otherwise a one to many will be created.

In case of the conversation ID is not null and the conversation already exist, if the text and the attachment are null, the draft will be deleted, otherwise the draft will be updated.

The completion callback in this method is useful when an error occurred while updating or creating a draft in the local database or when the message is added, updated or deleted successfully in the local database.

See also

Parameters

context

The application context

conversationID

Conversation ID

text

Message content text

attachment

Attachment model

isAvailableOnlyRecipients

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

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])

bearer

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

callback

This callback will be invoked to handle operation result :

  • Success : the draft is successfully added to the local data base
  • Error : an error occurred when trying to add the draft to the local data base