Skip to main content

Typing Status

The application can send the current user's typing status in a one-to-one chat session. Upon receiving the notification, the recipient can display "xxx is typing" in the UI.

Sending Typing Status Messages

Call sendTypingStatus when the current user is typing to send the current user's typing status.

[[RCIMClient sharedRCIMClient] sendTypingStatus:self.conversationType
targetId:self.targetId
contentType:[RCTextMessage getObjectName]];
ParameterTypeDescription
conversationTypeRCConversationTypeConversation type. This interface only supports one-to-one chat.
targetIdNSStringConversation ID
objectNameNSStringThe type name of the message being typed. For text messages, use [RCTextMessage getObjectName] to get the type name.

Listening to Typing Status

The application can use setRCTypingStatusDelegate to set the RCTypingStatusDelegate delegate to listen for typing status notifications in one-to-one chat sessions. When a typing status notification is received from the other party, the SDK will return the list of currently typing users and the message type through the onTypingStatusChanged callback method.

Setting the Delegate

[[RCIMClient sharedRCIMClient] setRCTypingStatusDelegate:self];

Delegate Method

@protocol RCTypingStatusDelegate <NSObject>

/*!
Callback for changes in user typing status

@param conversationType Conversation type
@param targetId Target ID of the conversation
@param userTypingStatusList List of RCUserTypingStatus currently typing (nil means no user is currently typing)

@discussion
When the client receives a change in the user's typing status, this interface will be called back to notify the conversation where the change occurred and the list of RCUserTypingStatus currently typing.

@warning Currently, only one-to-one chat is supported.
*/
- (void)onTypingStatusChanged:(RCConversationType)conversationType
targetId:(NSString *)targetId
status:(NSArray *)userTypingStatusList;

@end