changeInputStates
Description
info
Change input states.
Note
When typing is finished, focus needs to be set 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 | Is typing focus |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | ~ | Operation successful 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 | Is typing focus |
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 | Is typing focus |
Return Result
Code Example
OpenIMClient.getInstance().conversationManager.changeInputState(new OnBase<String>() {
@Override
public void onError(int code, String error) {
// todo: handle error information
}
@Override
public void onSuccess(String data) {
// todo: request successful
}
}, 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 | Is typing focus |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
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();
// use in mini program
// import { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.changeInputStates({
conversationID: 'conversationID',
focus: true,
})
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
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 | Is typing focus |
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
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('changeInputStates', IMSDK.uuid(), {
conversationID: 'conversationID',
focus: true,
})
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.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 | Is typing focus |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
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.changeInputStates({
conversationID: 'conversationID',
focus: true,
})
.then(() => {
// Call successful
})
.catch((error) => {
// Call failed
});
Note
Not implemented