typingStatusUpdate
Feature Introduction
Note
Send typing status, the recipient will receive it only if they are online on IM.
Caution
Related Callbacks: onRecvNewMessage onRecvNewMessages
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future typingStatusUpdate({
required String userID,
String? msgTip,
String? operationID,
})
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
userID | String | Yes | Receiver's ID |
msgTip | String | Yes | Custom content prompt |
Return Results
Name | Type | Description |
---|---|---|
~ | ~ | If no exception, operation is successful |
Code Example
await OpenIM.iMManager.messageManager.typingStatusUpdate(userID: '',msgTip: 'typing');
// todo
Function Prototype
- (void)typingStatusUpdate:(NSString *)recvID
msgTip:(NSString *)msgTip
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
recvID | NSString | Yes | Receiver's ID |
msgTip | NSString | Yes | Custom content prompt |
Return Results
Name | Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager typingStatusUpdate:@""
msgTip:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void typingStatusUpdate(OnBase<String> base, String userID, String msgTip)
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
base | OnBase<String> | Yes | Callback interface |
userID | String | Yes | Receiver's ID |
msgTip | String | Yes | Custom hint message |
Return Results
Name | Type | Description |
---|---|---|
~ | ~ | If no exception, operation is successful |
Code Example
OpenIMClient.getInstance().messageManager.typingStatusUpdate(new OnBase<String>() {
public void onError(int code, String error) {
}
public void onSuccess(String data) {
}
},userID, msgTip);
Function Prototype
IMSDK.typingStatusUpdate({
recvID: string;
msgTip: string;
}, operationID?: string): Promise<WsResponse>
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
recvID | string | Yes | Receiver's ID |
msgTip | string | Yes | Custom content prompt |
Return Results
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Successful callback |
Promise.catch() | Promise<WsResponse> | Failed 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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.typingStatusUpdate({
recvID: 'recvID',
msgTip: 'yes',
})
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('typingStatusUpdate', operationID: string, {
recvID: string;
msgTip: string;
}): Promise<void>
Input Parameters
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem location, recommended to use current time and random number |
recvID | string | Yes | Receiver's ID |
msgTip | string | Yes | Custom content prompt |
Return Results
The function is promisified through the
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to determine and handle successful and failed 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('typingStatusUpdate', IMSDK.uuid(), {
recvID: 'recvID',
msgTip: 'yes',
})
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.typingStatusUpdate({
recvID: string,
msgTip: string,
}, operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
recvID | string | Yes | Receiver ID |
msgTip | string | Yes | Custom content prompt |
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
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.typingStatusUpdate({
recvID: 'recvID',
msgTip: 'yes',
}, 'operationID')
.then((data) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void TypingStatusUpdate(OnBase<bool> cb, string recvId, string msgTip)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase | Yes | Callback |
userId | string | Yes | Receiver ID |
msgTip | string | Yes | Custom content prompt |
Return Result
Code Example
IMSDK.((suc,errCode,errMsg)=>{
},userId, msgTip);