changeInputStates
Function Introduction
Note
Change the input state.
Caution
When input is finished, set the focus value to false.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future changeInputStates({
    required String conversationID,
    required bool focus,
    String? operationID,
  })
Input Parameters
| Parameter Name | Parameter Type | Required | Description | 
|---|---|---|---|
| conversationID | String | Yes | Conversation ID | 
| focus | bool | Yes | Whether currently inputting | 
Return Result
| Name | Type | Description | 
|---|---|---|
| ~ | ~ | Operation succeeded if no exception thrown | 
Code Example
    await OpenIM.iMManager.conversationManager.changeInputStates(conversationID: conversationID, focus: focus);
    //todo
Function Prototype
- (void)changeInputStates:(NSString *)conversationID
                    focus:(BOOL)focus
                 onSuccess:(nullable OIMSuccessCallback)onSuccess
                 onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description | 
|---|---|---|---|
| conversationID | NSString | Yes | Conversation ID | 
| focus | BOOL | Yes | Whether currently inputting | 
Return Result
| Name | Type | Description | 
|---|---|---|
| onSuccess | OIMSuccessCallback | Success return | 
| onFailure | OIMFailureCallback | Failure return | 
Code Example
[OIMManager.manager changeInputStates:@"" 
                                focus:
                           onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void changeInputState(OnBase<String> base, String conversionId, boolean focus)
Input Parameters
| Parameter Name | Parameter Type | Required | Description | 
|---|---|---|---|
| conversationID | String | Yes | Conversation ID | 
| focus | boolean | Yes | Whether currently inputting | 
Return Result
Code Example
OpenIMClient.getInstance().conversationManager.changeInputState(new OnBase<String>() {
    @Override
    public void onError(int code, String error) {
        // todo: handle success
    }
    @Override
    public void onSuccess(String data) {
        // todo: request fail
    }
}, conversationID , focus);
Function Prototype
IMSDK.changeInputStates({
  conversationID: string,
  focus: boolean,
}, operationID?: string): Promise<WsResponse>
Input Parameters
| Parameter Name | Parameter Type | Required | Description | 
|---|---|---|---|
| conversationID | string | Yes | Conversation ID | 
| focus | boolean | Yes | Whether currently inputting | 
| operationID | string | No | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number | 
Return Result
| Name | Type | Description | 
|---|---|---|
| Promise.then() | Promise<WsResponse> | Success return | 
| Promise.catch() | Promise<WsResponse> | Failure return | 
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.changeInputStates({
  conversationID: 'conversationID',
  focus: true,
})
  .then(() => {
    // success
  })
  .catch(({ errCode, errMsg }) => {
    // failure
  });
Function Prototype
IMSDK.asyncApi('changeInputStates', operationID: string, {
  conversationID: string,
  focus: boolean,
}): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description | 
|---|---|---|---|
| conversationID | string | Yes | Conversation ID | 
| focus | boolean | Yes | Whether currently inputting | 
| operationID | string | Yes | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number | 
Return Result
| Name | Type | Description | 
|---|---|---|
| Promise.then() | Promise<void> | Success return | 
| Promise.catch() | Promise<CatchResponse> | Failure return | 
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('changeInputStates', IMSDK.uuid(), {
  conversationID: 'conversationID',
  focus: true,
})
  .then(() => {
    // success
  })
  .catch(({ errCode, errMsg }) => {
    // failure
  });
Function Prototype
OpenIMSDKRN.changeInputStates({
  conversationID: string,
  focus: boolean,
}, operationID: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description | 
|---|---|---|---|
| conversationID | string | Yes | Conversation ID | 
| focus | boolean | Yes | Whether currently inputting | 
| operationID | string | Yes | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number | 
Return Result
| Name | Type | Description | 
|---|---|---|
| Promise.then() | Promise<void> | Success return | 
| Promise.catch() | Promise<CatchResponse> | Failure return | 
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.changeInputStates({
  conversationID: 'conversationID',
  focus: true,
}, 'operationID')
  .then(() => {
    // success
  })
  .catch(({ errCode, errMsg }) => {
    // failure
  });
Caution
not implement