getInputStates
Function Introduction
Note
Get the current input state of a user.
- 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 succeeded if no exception thrown |
Code Example
await OpenIM.iMManager.conversationManager.getInputstates(conversationID: conversationID, userID: 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 success
}
@Override
public void onSuccess(List<Integer> data) {
// todo: request fail
}
}, 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, 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<number[]>> | 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.getInputstates({
conversationID: 'conversationID',
userID: 'userID',
})
.then(() => {
// success
})
.catch(({ errCode, errMsg }) => {
// failure
});
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, 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<number[]> | Success return |
Promise.catch() | Promise<CatchResponse> | Failure return |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getInputstates', IMSDK.uuid(), {
conversationID: 'conversationID',
userID: 'userID',
})
.then(() => {
// success
})
.catch(({ errCode, errMsg }) => {
// failure
});
Function Prototype
OpenIMSDKRN.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 | 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<number[]> | Success return |
Promise.catch() | Promise<CatchResponse> | Failure return |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getInputstates({
conversationID: 'conversationID',
userID: 'userID',
}, 'operationID')
.then(() => {
// success
})
.catch(({ errCode, errMsg }) => {
// failure
});
Caution
not implement