Typing Indicators
Product deprecation notice
Effective April 30th, 2026, Vonage In-App Messaging will no longer be available. Access for new users will be closed, and the service will be discontinued for all existing users.
If you have any questions regarding this product’s discontinuation, please contact your account manager or our support team.
Overview
This guide covers text typing indicators within a conversation.
Before you begin, make sure you added the SDK to your app and you are able to create a conversation.
NOTE: A step-by-step tutorial to build a chat application is available here.
This guide will make use of the following concepts:
- Conversation Events -
text:typing:on(start typing) andtext:typing:off(stop typing) events that fire on a Conversation, after you are a Member
Typing Indicators
Typing Indicators are used to notify conversation members on whether or not a member is currently typing a text message.
Send typing state events
Set the Member's current typing (on/off) state when they start or stop typing a text message:
// call this when a member starts typing
conversation.startTyping()
// call this when a member stops typing
conversation.stopTyping()
Listen for the state of other members
The following will listen for the typing (on/off) events created by the above calls:
// Option 1: Listen for typing events using NexmoTypingEventListener
conversation.addTypingEventListener(typingEventListener)
// or
// Option 2: Listen for typing events using NexmoMessageEventListener
conversation.addMessageEventListener(messageListener)
private val typingEventListener = NexmoTypingEventListener { typingEvent ->
val typingState = if(typingEvent?.state == NexmoTypingState.ON) "typing" else "not typing"
Timber.d("User ${typingEvent.fromMemberId} is $typingState")
}
private val messageListener = object : NexmoMessageEventListener {
override fun onTypingEvent(typingEvent: NexmoTypingEvent) {
val typingState = if(typingEvent.state == NexmoTypingState.ON) "typing" else "not typing"
Log.d("TAG", "User ${typingEvent.fromMemberId} is $typingState")
}
override fun onAttachmentEvent(attachmentEvent: NexmoAttachmentEvent) {}
override fun onTextEvent(textEvent: NexmoTextEvent) {}
override fun onSeenReceipt(seenEvent: NexmoSeenEvent) {}
override fun onEventDeleted(deletedEvent: NexmoDeletedEvent) {}
override fun onDeliveredReceipt(deliveredEvent: NexmoDeliveredEvent) {}
}
Add NXMConversationDelegate as an extension to a ViewController or similar, and implement conversation(_ conversation: NXMConversation, didReceive event: NXMTextTypingEvent):
Note: The first method below is required when implementing NXMConversationDelegate:
Have a ViewController, or similar, conform to NXMConversationDelegate and implement conversation:didReceiveTypingEvent::
Note: The first method below is required when implementing NXMConversationDelegate: