createQuoteMessage
Feature Introduction
Description
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 | Mandatory | Description |
---|---|---|---|
text | String | Yes | Text content |
quoteMsg | Message | Yes | Message being quoted |
Return Result
Name | Type | Description |
---|---|---|
~ | Message | Success |
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 | Mandatory | Description |
---|---|---|---|
text | NSString | Yes | Text content |
message | OIMMessageInfo | Yes | Message being quoted |
Return Result
Name | Type | Description |
---|---|---|
msg | OIMMessageInfo | Success |
Code Example
OIMMessageInfo *msg = [OIMMessageInfo createQuoteMessage:@""
message:];
Function Prototype
public Message createQuoteMessage(String text, Message message)
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
text | String | Yes | Text content |
quoteMsg | Message | Yes | Message being quoted |
Return Result
Name | Type | Description |
---|---|---|
~ | Message | Success |
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 | Mandatory | Description |
---|---|---|---|
text | string | Yes | Text content |
message | MessageItem | Yes | Message being quoted |
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 | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for troubleshooting, must be unique. It's recommended to use the current time and random number. |
text | string | Yes | Text content |
message | MessageItem | Yes | Message being quoted |
Return Result
The function is made Promise by the
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to 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
OpenIMSDKRN.createQuoteMessage({
text: string,
message: MessageItem,
}, operationID: string): Promise<MessageItem>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
text | string | Yes | Text content |
message | MessageItem | Yes | Message being quoted |
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";
const message = { ... } as MessageItem
OpenIMSDKRN.createQuoteMessage({
text: '',
message: {
...
},
}, 'operationID')
.then((data) => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
public static Message CreateQuoteMessage(string text, Message message)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
text | string | Yes | Text content |
message | Message | Yes | Message being quoted |
Return Result
Parameter Name | Type | Description |
---|---|---|
~ | Message | Message Struct |
Code Example
var msg = IMSDK.CreateQuoteMessage(Text,message);