How to create the Private chat system with Photon Chat?
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Photon Chat.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
How to create the Private chat system with Photon Chat?
Albertkaruna
2017-05-26 06:08:48
I have almost done it but before showing the message it doesn't show the new messages.
if anyone has done the private chat system, please let me know how to do it.
Thank you...
Comments
Hi @Albertkaruna,
Thank you for choosing Photon!
I don't understand what is the issue here.
Photon Chat allow you to send private messages from a single user to a single user using a single method call.
Albertkaruna
2017-05-27 10:03:20
I was tried but it wasn't working.
If you got any sample code, please show me that.
How to add players to private channel?
Photon "private channels" can have only two users.
You can use "public channels" with a name shared between few users (more than 2) so it work as "private channels" others can't see/subscribe to unless they guess the name.
Albertkaruna
2017-05-29 09:16:32
I've tried to use the private chat but still, i can't get the result. The examples that you're given doesn't have any examples for a private chat. So, please give me some example code.
Thank you.
To send private message:
chatClient.SendPrivateMessage(TargetUserId, message);
To recieve private message:
public class ChatClient : IChatClientListener {
public void OnPrivateMessage(string sender, object message, string channelName )
{
}
Albertkaruna
2017-05-29 13:37:15
Thank you @JohnTube . Now it's working fine.
I just copy pasted the docs.
AjayBhojani
2018-01-18 06:40:24
hi...
is it possible to get TargetUserId ? I want all user ids who is connected.
Thanks in advance....!