One to One Conversations

Last Edit: Mar 03 2020

Creating Conversations

Channels can be used to create one to one conversations between users as well. In most cases, you want conversations to be unique and make sure that two users have only a channel.

You can achieve this by leaving the channel ID empty and provide channel type, members, and custom data. When you do so, the API will ensure that only one channel for the members you specified exists (the order of the members does not matter).

You cannot add/remove members for channels created this way.

const conversation = client.channel('messaging', {
    members: ['thierry', 'tommaso'],
});
                    

$conversation = $client->Channel('messaging', 'thierry-jenny', ['members'=>['thierry', 'jenny']]);
$state   = $conversation->create('thierry');
                    

client.channel("messaging", extraData: {"members": ["thierry", "tommaso"]});
                    

val members = listOf("thierry", "tommaso")
channelController.create("messaging", members).enqueue {
    val channel = it.data()
}