Photon-Playcanvas: how to chat?

Hello.
gonna implement chat as a part of photon multiplayer app.
the main thing is to display message near player who wrote it.

I see 2 approaches:

  1. have an event code for chat message and raise event with that code and message data as it is here
    GitHub - utautattaro/Photon-for-PlayCanvas: PlayCanvas plugin for online multiplayer webGL Apps using photon :)
  2. there is ChatClient class in docs Photon JavaScript Client API: Class: ChatClient
    it has methods for sending and receiving messages
    but i’m not sure about “subscription” as it is written in docs
    and i do not see the way to get user who sent message

which approach is better in you opinion?

@DevilZ do you have a point of view on this?

2 Likes

Hey @Dima_Romanchuk,

In my experience at least, none of these methods have really given me great results. I would recommend using a third party chat provider, I use CometChat Pro for all my projects that need this. Its chat widget is super easy to integrate, and it supports voice and video call as well. You can also consider using the tlk.io chat, though this is not as feature rich as CometChat Pro.

4 Likes

ok, thank you

one more question
how to use ChatClient class?
what is the sequence of actions (creating instance in app.js, subscribe to room on player join and so on)?

just want to understand the mechanism of this way

thank you

Unfortunately I have not been able to implement this in the PlayCanvas framework yet. Perhaps @Ryotaro.TSUDA, the developer of the library, can lend a hand here?

1 Like

my “progress” is reaching an error after subscribing on channel
image

Hello there! I have some experience using Photon Chat for simple projects. I stumbled upon this thread and thought I’d share my project with you. If it’s helpful, I’d be happy if you could take a look.

Project URL: PlayCanvas | HTML5 Game Engine
Publish URL: [Demo] photon-chat - PLAYCANVAS

1 Like