Send a Typing Indicator
In other words, as a sender, how do I let the recipient(s) know that I’m typing?Start Typing
You can use thestartTyping() method to inform the receiver that the logged-in user has started typing. The receiver will receive this information in the onTypingStarted() method of the CometChatMessageDelegate protocol conformance. In order to send the typing indicator, you need to use the TypingIndicator class.
- Swift
- Objective C
Stop Typing
You can use theendTyping() method to inform the receiver that the logged-in user has stopped typing. The receiver will receive this information in the onTypingEnded() method of the CometChatMessageDelegate protocol conformance. In order to send the typing indicator, you need to use the TypingIndicator class.
- Swift
- Objective C
Custom DataYou can use the
metaData field of the TypingIndicator class to pass additional data along with the typing indicators. A metaData field is a dictionary and this property can be set from TypingIndicator class. This data will be received at the receiver end and can be obtained using the metaData property.Real-time Typing Indicators
In other words, as a recipient, how do I know when someone is typing? You will receive the typing indicators in theonTypingStarted() and the onTypingEnded() method of the CometChatMessageDelegate. In order to receive typing indicators, you must add protocol conformance CometChatMessageDelegate.
- Swift
- Objective C
TypingIndicator class consists of the below parameters: