- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conversation | Conversation | Conversation identifier | 1.0.0 |
| isTop | boolean | Whether the conversation is pinned | 1.0.0 |
| callback | ISimpleCallback | Result callback | 1.0.0 |
Code Example
JIM.getInstance().getConversationManager().setTop(conversation, true, new IConversationManager.ISimpleCallback() {
@Override
public void onSuccess() {
}
@Override
public void onError(int errorCode) {
}
});
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| isTop | BOOL | Whether the conversation is pinned | 1.0.0 |
| conversation | JConversation | Conversation identifier | 1.0.0 |
| successBlock | Success callback | 1.0.0 | |
| errorBlock | Failure callback | 1.0.0 |
Code Example
JConversation *conversation = [[JConversation alloc] initWithConversationType:JConversationTypePrivate conversationId:@"userId1"];
[JIM.shared.conversationManager setTop:YES
conversation:conversation
success:^{
} error:^(JErrorCode code) {
}];
Pin a conversation. Cross-client synchronization is supported. A successful call triggers the conversation change listener.
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.isTop | Boolean | Yes | None | Whether the conversation is pinned | 1.0.0 |
Code Example
let { ConversationType } = JIM;
let conversation = {
conversationType: ConversationType.PRIVATE,
conversationId: 'userId01',
isTop: true
};
jim.setTopConversation(conversation).then(() => {
console.log('set conversation top successfully');
});
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conver | Conversation | Conversation identifier | 1.0.0 |
| isTop | boolean | Whether the conversation is pinned | 1.0.0 |
| callback | CommonCallback | Result callback | 1.0.0 |
Code Example
let conver = new Conversation("userid1",1)
JuggleIm.instance.getConversationManager().setTop(conver,true,(code)=>{
})
Pin a conversation. Cross-client synchronization is supported. A successful call triggers the conversation change listener.
Parameters
| Name | Type | Description | Version |
|---|---|---|---|
| conversation | Conversation | Conversation identifier | 0.6.3 |
| isTop | bool | Whether the conversation is pinned | 0.6.3 |
Code Example
Conversation conversation = Conversation(ConversationType.private, 'user1');
await JuggleIm.instance.setTop(conversation, true);
Pin a conversation. Cross-client synchronization is supported. A successful call triggers the conversation change 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 |
| isTop | Boolean | Whether the conversation is pinned | 0.6.3 |
Code Example
import JuggleIM from 'juggleim-rnsdk';
await JuggleIM.setTop({
conversationType: 1,
conversationId: 'user1',
isTop: true
});