getInputStates
Description
info
Get a user's current input status.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future getInputstates({
required String conversationID,
required String userID,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
| userID | String | Yes | User ID |
Return Result
| Name | Type | Description |
|---|---|---|
| ~ | Future< List< int>?> | Operation successful if no exception is thrown |
Code Example
await OpenIM.iMManager.conversationManager.getInputstates(conversationID: conversationID, userID: );
//todo
Function Prototype
- (void)getInputstates:(NSString *)conversationID
userID:(NSString)userID
onSuccess:(nullable OIMInputStatusChangedCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | NSString | Yes | Conversation ID |
| userID | NSString | Yes | User ID |
Return Result
| Name | Type | Description |
|---|---|---|
| onSuccess | NSArray< NSNumber *> | Success return |
| onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager getInputstates:@""
userID:
onSuccess:^(NSArray<NSNumber *> * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getInputState(OnBase<List<Integer>> base, String conversionId, String userId)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | String | Yes | Conversation ID |
| userId | String | Yes | User ID |
Return Result
Code Example
OpenIMClient.getInstance().conversationManager.getInputState(new OnBase<List<Integer>>() {
@Override
public void onError(int code, String error) {
// todo: handle error information
}
@Override
public void onSuccess(List<Integer> data) {
// todo: request successful
}
}, conversationID , userId);
Function Prototype
IMSDK.getInputstates({
conversationID: string,
userID: string,
}, operationID?: string): Promise<WsResponse<number[]>>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | string | Yes | Conversation ID |
| userID | string | Yes | User ID |
| 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<number[]>> | 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.getInputstates({
conversationID: 'conversationID',
userID: 'userID',
})
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('getInputstates', operationID: string, {
conversationID: string,
userID: string,
}): Promise<number[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | string | Yes | Conversation ID |
| userID | string | Yes | User ID |
| 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<number[]> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getInputstates', IMSDK.uuid(), {
conversationID: 'conversationID',
userID: 'userID',
})
.then(() => {
// Call successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDK.getInputstates({
conversationID: string,
userID: string,
}, operationID?: string): Promise<number[]>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| conversationID | string | Yes | Conversation ID |
| userID | string | Yes | User ID |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<number[]> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.getInputstates({
conversationID: 'conversationID',
userID: 'userID',
})
.then(() => {
// Call successful
})
.catch((error) => {
// Call failed
});
Note
Not implemented