createQuoteMessage
Description
info
Create a quote (reply) message.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<Message> createQuoteMessage({
required String text,
required Message quoteMsg,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| text | String | Yes | Text content |
| quoteMsg | Message | Yes | Replied message |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | Message | Success return |
Code Example
Message msg = await OpenIM.iMManager.messageManager.createQuoteMessage(text: text, quoteMsg: quoteMsg);
//todo
Function Prototype
+ (OIMMessageInfo *)createQuoteMessage:(NSString *)text
message:(OIMMessageInfo *)message;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| text | NSString | Yes | Text content |
| message | OIMMessageInfo | Yes | Replied message |
Return Result
| Name | Type | Description |
|---|---|---|
| msg | OIMMessageInfo | Success return |
Code Example
OIMMessageInfo *msg = [OIMMessageInfo createQuoteMessage:@""
message:];
Function Prototype
public Message createQuoteMessage(String text, Message message)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| text | String | Yes | Text content |
| quoteMsg | Message | Yes | Replied message |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | Message | Success return |
Code Example
Message Message= OpenIMClient.getInstance().messageManager.createQuoteMessage( text, message);
Function Prototype
IMSDK.createQuoteMessage({
text: string;
message: MessageItem;
}, operationID?: string): Promise<WsResponse<MessageItem>>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text content |
| message | MessageItem | Yes | Replied message |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse<MessageItem>> | Success callback |
| Promise.catch() | Promise<WsResponse> | Failure 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 { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.createQuoteMessage({
text: '',
message: {
...
},
})
.then(({data}) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('createQuoteMessage', operationID: string, {
text: string;
message: MessageItem;
}): Promise<MessageItem>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| text | string | Yes | Text content |
| message | MessageItem | Yes | Replied message |
Return Result
Use the
openim-uniapp-polyfillpackage to make the function Promise. When calling, you need to usethenandcatchto determine and handle success and failure callbacks.
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<MessageItem> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
const message = { ... } as MessageItem
IMSDK.asyncApi('createQuoteMessage', IMSDK.uuid(), {
text: '',
message: {
...
},
})
.then((data) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.createQuoteMessage({
text: string,
message: MessageItem,
}, operationID?: string): Promise<MessageItem>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| text | string | Yes | Text content |
| message | MessageItem | Yes | Replied message |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<MessageItem> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
const message = { ... } as MessageItem
OpenIMSDK.createQuoteMessage({
text: '',
message: {
...
},
})
.then((data) => {
// Call successful
})
.catch((error) => {
// Call failed
});
Function Prototype
public static Message CreateQuoteMessage(string text, Message message)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text content |
| message | Message | Yes | Replied message |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | Message | Success return |
Code Example
var msg = IMSDK.CreateQuoteMessage(Text,message);