UCMA – I’m Writing a Message

I was working on a UCMA (Unified Communications Managed API) issue the other day and wanted to integrate the “Is Writing a message” functionality that is oh so important in any chat conversation today.  My application is pretty simple, a chat bot is listening to incoming requests and directing them to their intended recipient.

You can see this in some of the built in examples, but if you haven’t looked there yet, this functionality is quite easy to implement.

In your MessageReceived event from your Message Flow, simply add the following line into the event before you send back your reply and this will trigger an event to fire when this occurs.

MessageFlow.LocalComposingState = ComposingState.Composing;

And that’s it, now you can know when the receiving user start to type a response, even when they take a pause only to have it fire again.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s