createMergeMessage
Feature Introduction
Description
Create a merge message by combining multiple messages into one. The parameters include a title, summary, and multiple messages.
Note
It is recommended to keep the total number of merged messages within 100.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<Message> createMergerMessage({
required List<Message> messageList,
required String title,
required List<String> summaryList,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
messageList | List<Message> | Yes | Message list |
title | String | Yes | Title |
summaryList | List<String> | Yes | Message summary list |
Return Result
Name | Type | Description |
---|---|---|
~ | Message | Successful return |
Code Example
Message msg = await OpenIM.iMManager.messageManager.createMergerMessage(messageList: messageList, title: title, summaryList: summaryList);
//todo
Function Prototype
+ (OIMMessageInfo *)createMergeMessage:(NSArray <OIMMessageInfo *> *)messages
title:(NSString *)title
summaryList:(NSArray <NSString *> *)summarys;
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
messages | NSArray < OIMMessageInfo * > | Yes | Message list |
title | NSString | Yes | Title |
summarys | NSArray <NSString *> | Yes | Message summary list |
Return Result
Name | Type | Description |
---|---|---|
message | OIMMessageInfo | Successful return |
Code Example
OIMMessageInfo *message = [OIMMessageInfo createMergeMessage:@[]
title:@""
summaryList:@[]];
Function Prototype
public Message createMergerMessage(List<Message> messageList, String title, List<String> summaryList)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
messageList | List<Message> | Yes | Message list |
title | String | Yes | Title |
summaryList | List<String> | Yes | Message summary list |
Return Result
Name | Type | Description |
---|---|---|
~ | Message | Successful return |
Code Example
Message Message= OpenIMClient.getInstance().messageManager.createMergerMessage( messageList, title, summaryList);
Function Prototype
IMSDK.createMergerMessage({
messageList: MessageItem[];
title: string;
summaryList: string[];
}, operationID?: string): Promise<WsResponse<MessageItem>>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
messageList | MessageItem[] | Yes | Message list |
title | string | Yes | Title |
summaryList | string[] | Yes | Message summary list |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<MessageItem>> | Successful callback |
Promise.catch() | Promise<WsResponse> | Failed callback |
Code Example
import { getSDK } from '@openim/wasm-client-sdk';
const IMSDK = getSDK();
// use in electron with ffi
// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';
// const { instance: IMSDK } = getWithRenderProcess();
// use in mini program
// import { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.createMergerMessage({
messageList: [
{
// message
...
}
],
title: "Chat record with xx",
summaryList: ["xx: Hello", "xx: Hello"];
})
.then(({ data }) => {
// Successfully called
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('createMergerMessage', operationID: string, {
messageList: MessageItem[];
title: string;
summaryList: string[];
}): Promise<MessageItem>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem positioning, maintain uniqueness, suggest using the current time and random numbers |
messageList | MessageItem[] | Yes | Message list |
title | string | Yes | Title |
summaryList | string[] | Yes | Message summary list |
Return Result
The function is made Promise-based using
openim-uniapp-polyfill
package. You need to usethen
andcatch
to determine and handle the success and failure callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<MessageItem> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('createMergerMessage', IMSDK.uuid(), {
messageList: [
{
// message
...
}
],
title: "Chat records with xx",
summaryList: ["xx: Hello", "xx: Hello"];
})
.then((data) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDKRN.createMergerMessage({
title: string,
messageList: Array,
summaryList: Array,
}, operationID: string): Promise<MessageItem>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
messageList | MessageItem[] | Yes | Message list |
title | string | Yes | Title |
summaryList | string[] | Yes | Message summary list |
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<MessageItem> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.createMergerMessage({
messageList: [
{
// message
...
}
],
title: "Chat records with xx",
summaryList: ["xx: Hello", "xx: Hello"];
})
.then((data) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
public static Message CreateMergerMessage(Message[] messageList, string title, string[] summaryList)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
messageList | Message[] | Yes | Message list |
title | string | Yes | Title |
summaryList | string[] | Yes | Message summary list |
Return Result
Parameter Name | Type | Description |
---|---|---|
~ | Message | Message Struct |
Code Example
var msg = IMSDK.CreateMergerMessage(messageList,title,summaryList);