createForwardMessage
Function Introduction
Description
Create a forwarded message.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<Message> createForwardMessage({
required Message message,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
message | Message | Yes | Message to be forwarded |
Return Result
Name | Type | Description |
---|---|---|
~ | Message | Successful return |
Code Example
Message msg = await OpenIM.iMManager.messageManager.createForwardMessage(message: message);
//todo
Function Prototype
+ (OIMMessageInfo *)createForwardMessage:(OIMMessageInfo *)msg;
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
msg | OIMMessageInfo | Yes | Message to be forwarded |
Return Result
Name | Type | Description |
---|---|---|
message | OIMMessageInfo | Successful return |
Code Example
OIMMessageInfo *message = [OIMMessageInfo createForwardMessage: ];
Function Prototype
public Message createForwardMessage(Message message)
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
message | Message | Yes | Message to be forwarded |
Return Result
Name | Type | Description |
---|---|---|
~ | Message | Successful return |
Code Example
Message Message= OpenIMClient.getInstance().messageManager. createForwardMessage( message)
//todo
Function Prototype
IMSDK.createForwardMessage(message:MessageItem, operationID?: string): Promise<WsResponse<MessageItem>>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
text | string | Yes | Text content |
message | MessageItem | Yes | Message to be forwarded |
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();
const message = {...} as MessageItem;
IMSDK.createForwardMessage(message)
.then(({data}) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('createForwardMessage', operationID: string, message: MessageItem): Promise<MessageItem>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used to locate issues. It is recommended to use the current time and a random number |
message | MessageItem | Yes | Message to be forwarded |
Return Result
The
openim-uniapp-polyfill
package promises the function. When calling, usethen
andcatch
to judge and handle the 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('createForwardMessage', IMSDK.uuid(), message)
.then((data) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDKRN.createForwardMessage( message: MessageItem, operationID: string): Promise<MessageItem>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
message | MessageItem | Yes | Message to be forwarded |
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";
const message = {...} as MessageItem;
OpenIMSDKRN.createForwardMessage(message, 'operationID')
.then((data) => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});