setMessageLocalEx
Description
info
Modify the local message ex field, e.g., setting the save path after downloading a file.
Note
Related Callback:
onConversationChanged
If the modified message is the latest message, the latest message of the conversation will change.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron
- React-Native
- Unity
Function Prototype
Future setMessageLocalEx({
required String conversationID,
required String clientMsgID,
required String localEx,
String? operationID,
});
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
| clientMsgID | String | Yes | Message ID |
| localEx | String | Yes | ex info to set |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| then | void | Success callback |
| onError | Function | Failure callback |
Code Example
OpenIM.iMManager.messageManager.setMessageLocalEx(conversationID: '', clientMsgID: '', localEx: 'localEx');
Function Prototype
- (void)setMessageLocalEx:(NSString *)conversationID
clientMsgID:(NSString *)clientMsgID
localEx:(NSString *)localEx
onSuccess:(OIMSuccessCallback)onSuccess
onFailure:(OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | NSString | Yes | Conversation ID |
| clientMsgID | NSString | Yes | Message ID |
| localEx | NSString | Yes | ex info to set |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success callback |
| onFailure | OIMFailureCallback | Failure callback |
Code Example
[OIMManager.manager setMessageLocalEx:@""
clientMsgID:@""
localEx:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void setMessageLocalEx(OnBase<String> callBack, String conversationID, String clientMsgID, String localEx)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| OnBase | OnBase | Yes | Callback interface |
| conversationID | String | Yes | Conversation ID |
| clientMsgID | String | Yes | Message ID |
| localEx | String | Yes | ex info to set |
Code Example
OpenIMClient.getInstance()
.messageManager.setMessageLocalEx(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},conversationID,clientMsgID,localEx);
Function Prototype
IMSDK.setMessageLocalEx({
conversationID: string;
clientMsgID: string;
localEx: string;
}, operationID?: string): Promise<WsResponse>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | string | Yes | Conversation ID |
| clientMsgID | string | Yes | Message ID |
| localEx | string | Yes | ex info to set |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse> | 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();
IMSDK.setMessageLocalEx({
conversationID: 'conversationID',
clientMsgID: 'clientMsgID',
localEx: 'localEx',
})
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('setMessageLocalEx', operationID: string, {
conversationID: string;
clientMsgID: string;
localEx: string;
}): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| conversationID | string | Yes | Conversation ID |
| clientMsgID | string | Yes | Message ID |
| localEx | string | Yes | ex info to set |
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<void> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('setMessageLocalEx', IMSDK.uuid(), {
conversationID: 'conversationID',
clientMsgID: 'clientMsgID',
localEx: 'localEx',
})
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.setMessageLocalEx( {
conversationID: string;
clientMsgID: string;
localEx: string;
}, operationID?: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| conversationID | string | Yes | Conversation ID |
| clientMsgID | string | Yes | Message ID |
| localEx | string | Yes | ex info to set |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<void> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.setMessageLocalEx({
conversationID: 'conversationID',
clientMsgID: 'clientMsgID',
localEx: 'localEx',
})
.then(() => {
// Call successful
})
.catch((error) => {
// Call failed
});
Function Prototype
public static void SetMessageLocalEx(OnBase<bool> cb, string conversationId, string clientMsgId, string localEx)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase | Yes | Callback interface |
| conversationId | string | Yes | Conversation ID |
| clientMsgId | string | Yes | Message ID |
| localEx | string | Yes | ex info to set |
Code Example
IMSDK.SetMessageLocalEx((suc,errCode,errMsg)=>{
},conversationId,clientMsgId,localEx);