Browse SDKs · iOS
Platform
SDKsiOS

Report typing status

Report the current user’s typing status with OpenIM iOS SDK.

Copy

When the user begins typing text in the input bar or ceases input, invoke changeInputStates:focus:onSuccess:onFailure: on OIMManager to synchronize the typing indicator with remote members in the conversation:

Parameters

ParameterTypeRequiredDescription
conversationIDNSString *YesTarget conversation identifier.
focusBOOLYesInput focus flag. Pass YES when input commences; pass NO when the message is sent, focus is lost, the conversation switches, or typing halts.
onSuccessOIMSuccessCallbackYesSuccess callback confirming the server accepted the typing status request.
onFailureOIMFailureCallbackYesFailure callback returning error code code and descriptive message msg.

Code example

[[OIMManager manager] changeInputStates:conversationID
                                  focus:YES
                              onSuccess:^(NSString * _Nullable data) {
    // Typing indicator reported successfully
}
                              onFailure:^(NSInteger code, NSString * _Nullable msg) {
    // Handle reporting failure
}];

Return value

The onSuccess callback confirms that the server accepted the input state change. The response data does not return a persistent record.

State changes after the call

  1. Ephemeral nature: Typing status is a transient state scoped to conversationID. It is not stored in the database, does not create drafts, and is not recorded in conversation history. Debounce or throttle start-typing invocations to avoid excessive network overhead.
  2. Receiving typing updates: Counterparties receive typing updates through onConversationUserInputStatusChanged: in OIMConversationListener, which tracks active input platform IDs keyed by composite identity conversationID:userID. For complete conversation listener setup and teardown, see Retrieve conversation list. To actively poll input states, see Retrieve typing status.