I implemented swift client for chat, and Laravel as server. This works on my iPhone device, and I have channels which I can join and add messages to. However, I want the users to be able to chat 1 on 1 only. How do I implement this? Any experience with this?
Asked
Active
Viewed 317 times
1 Answers
1
If you have access to Twilio, you can set the channel members limit to 2 with in the base configuration of chat service. so that the chat will be 1-1.
or can use this block from twilio document
// Create a Channel
messagingClient.createChannel({
uniqueName: 'general',
friendlyName: 'General Chat Channel',
isPrivate: true
}).then(function(channel) {
console.log('Created general channel:');
console.log(channel);
});

user703894
- 51
- 1
- 5
-
Hi, the limitation to 2 sounds like a perfect solution. However, the alternate script that you wrote is for javascript. On my end there is Laravel, so PHP, not javascript. – Vladimir Despotovic Nov 20 '20 at 11:20
-
Laravel, I am not experienced with it. But, for PHP - setting the channel type to "Private" may work. Please refer this https://support.twilio.com/hc/en-us/articles/115005970527-Public-vs-Private-Channel-Use-Cases-with-Twilio-Programmable-Chat#:~:text=A%20private%20channel%20can%20not,be%20joined%20by%20non%2Dmembers. – user703894 Nov 22 '20 at 07:13