setMessageLocalEx
Feature Introduction
Description
Modify the local ex field of the message, such as setting the save path after downloading a file.
Note
Related Callback: onConversationChanged If the message being modified is the latest one, then the latest message in the conversation will change.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- 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 information to be set |
Return Value
Parameter Name | Parameter Type | Description |
---|---|---|
then | void | Callback on success |
onError | Function | Callback on error |
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 information to be set |
Return Value
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Callback on success |
onFailure | OIMFailureCallback | Callback on error |
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 |
conversationID | String | Yes | Conversation ID |
clientMsgID | String | Yes | Message ID |
localEx | String | Yes | ex information to be 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 information to be set |
Return Value
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Callback on success |
Promise.catch() | Promise<WsResponse> | Callback on error |
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.setMessageLocalEx({
conversationID: 'conversationID',
clientMsgID: 'clientMsgID',
localEx: 'localEx',
})
.then(() => {
// Callback on success
})
.catch(({ errCode, errMsg }) => {
// Callback on error
});
Function Prototype
IMSDK.asyncApi('setMessageLocalEx', operationID: string, {
conversationID: string;
clientMsgID: string;
localEx: string;
}): Promise<void>
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem locating, must be unique, recommended to use current time and random number |
conversationID | string | Yes | Conversation ID |
clientMsgID | string | Yes | Message ID |
localEx | string | Yes | Information to set for ex |
Return Results
Through the
openim-uniapp-polyfill
package, the function is made into a Promise. When calling, you need to usethen
andcatch
to judge and handle the success and failure callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<void> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('setMessageLocalEx', IMSDK.uuid(), {
conversationID: 'conversationID',
clientMsgID: 'clientMsgID',
localEx: 'localEx',
})
.then(() => {
// Call succeeded
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDKRN.setMessageLocalEx( {
conversationID: string;
clientMsgID: string;
localEx: string;
}, operationID: string): Promise<void>
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 |
conversationID | string | Yes | Conversation ID |
clientMsgID | string | Yes | Message ID |
localEx | string | Yes | Information to set for ex |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<void> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.setMessageLocalEx({
conversationID: 'conversationID',
clientMsgID: 'clientMsgID',
localEx: 'localEx',
}, 'operationID')
.then(() => {
// Call succeeded
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
### Function Prototype
public static void SetMessageLocalEx(OnBase<bool> cb, string conversationId, string clientMsgId, string localEx)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase | Callback | |
conversationId | string | Yes | Conversation ID |
clientMsgId | string | Yes | Message ID |
localEx | string | Yes | Information to set for ex |
Code Example
IMSDK.SetMessageLocalEx((suc,errCode,errMsg)=>{
},conversationId,clientMsgId,localEx);