How to send an IM message in vLine

151 views Asked by At

To be able to chat with someone by sending the vLine im-type messages, you don’t need to have a mediaSession established with the remote user first, correct? All you need is the remote person’s ID and you can send them message, correct?

Or not? And if not, how do you do send an IM with vLine?

1

There are 1 answers

1
tomtheengineer On BEST ANSWER

Correct. You do not need to have a mediaSession in order to send an IM. The vline.MediaSession is only used for audio and/or video sessions.

To send an IM, you just need to have the vline.Person object representing the person that you want to send the message to. You can then call postMessage or publishMessage to send the IM, with the difference between the two being that postMessage saves the IM history, while publishMessage does not.

Also, you can send IMs to a user even if that user is not online and use the Person.getUnreadCount API to keep track of the number of unread messages from a specific Person.