- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
Set a conversation draft. It is stored locally and is not synchronized to the cloud.
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conversation | Conversation | Conversation identifier | 1.0.0 |
| draft | String | Draft content | 1.0.0 |
Code Example
Conversation conversation = new Conversation(Conversation.ConversationType.GROUP, "groupid1");
JIM.getInstance().getConversationManager().setDraft(conversation, "draft");
Set a conversation draft. It is stored locally and is not synchronized to the cloud.
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| draft | NSString | Draft content | 1.0.0 |
| conversation | JConversation | Conversation identifier | 1.0.0 |
Code Example
JConversation *c = [[JConversation alloc] initWithConversationType:JConversationTypeGroup conversationId:@"groupid1"];
[JIM.shared.conversationManager setDraft:@"draft" inConversation:c];
Set a conversation draft. It is stored locally and is not synchronized to the cloud; changing browsers invalidates the draft. A successful call to set the draft does not trigger the conversation listener. Handle the UI as needed.
Parameters
| Name | Type | Required | Default | Description | Version |
|---|---|---|---|---|---|
| conversation | Object | Yes | None | Conversation object | 1.0.0 |
| conversation.conversationType | Number | Yes | None | Conversation type | 1.0.0 |
| conversation.conversationId | String | Yes | None | Conversation ID | 1.0.0 |
| conversation.draft | String | Yes | None | Draft content | 1.0.0 |
Code Example
let { ConversationType } = JIM;
let conversation = {
conversationType: ConversationType.PRIVATE,
conversationId: 'userId01',
draft: 'This is a conversation draft'
};
jim.setDraft(conversation).then(() => {
console.log('set conversation draft successfully');
});
Set a conversation draft. It is stored locally and is not synchronized to the cloud.
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conversation | Conversation | Conversation identifier | 1.0.0 |
| draft | String | Draft content | 1.0.0 |
Code Example
JuggleIm.instance.getConversationManager().setDraft(new Conversation("groupid1",2),"draft")
Set a conversation draft. It is stored locally and is not synchronized across clients. After it is set successfully, the conversation change listener is triggered; update the UI based on that listener.
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conversation | Conversation | Conversation identifier | 0.6.3 |
| draft | String | Draft content | 0.6.3 |
Code Example
Conversation conversation = Conversation(ConversationType.group, 'groupid1');
await JuggleIm.instance.setDraft(conversation, 'draft');
Set a conversation draft. It is stored locally and is not synchronized to the cloud. After it is set successfully, the conversation change listener is triggered; update the UI based on that listener.
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conversation | Object | Conversation identifier | 0.6.3 |
| conversationType | Number | Conversation type | 0.6.3 |
| conversationId | String | Conversation ID | 0.6.3 |
| draft | String | Draft content | 0.6.3 |
Code Example
import JuggleIM from 'juggleim-rnsdk';
await JuggleIM.setDraft({
conversationType: 2,
conversationId: 'groupid1',
draft: 'draft'
});