Send messages between users
Publish message to room participants or to specific users.
// Sender of the message (after 'session.connect')
arctosSdkInstance.$meetingRoom.publishSignal({
data: 'My custom message', // Any string (optional)
to: [], // Array of Connection objects (optional. Broadcast to everyone if empty)
type: 'MessageToModerator' // The type of message (optional)
})
.then(() => {
console.log('Message successfully sent');
})
.catch(error => {
console.error(error);
});
Subscribe to messages from other users:
// Receiver of the message (usually before calling 'session.connect')
arctosSdkInstance.$meetingRoom.subscribeSignal('MessageToModerator', (event) => {
console.log(event.data); // Message
console.log(event.from); // ConnectionId of the sender
});
You can also send private messages to specific users:
// Sender of the adressed message (after calling 'session.connect')
arctosSdkInstance.$meetingRoom.publishSignal({
data: 'My private custom message',
to: [connection1, connection2],
type: 'MyPrivateChannel'
});
The following url is a sample code for joining a meeting room.