Skip to main content
All CollectionsPortal Pages
Design | Messaging | Chat Channels
Design | Messaging | Chat Channels

Config chat channel

Franco Lago avatar
Written by Franco Lago
Updated over 2 years ago

Since chat messages are directed to channels, not users, we create a chat channel before our test.

Configs messaging service:

To get started, find the Chat Channel page on brainCloud portal.

  • Assuming you already Enabled chat service for your app from Design | Messaging | Chat page, if not, do it before starting the following test. Refer to this article for the detail.

  • Navigate to Design | Messaging | Chat Channels page, click [+New Channel] button and fill in the fields with essential values. Click the Save button to complete your creation.

  • You should find the channel you created on the list then.

Test:

  • Download the Unity chat example from here. Open the Chat-Example project through Unity Hub.

  • Test from the editor as shown below or build it into any platform that fits your test device.

  • Logging your app from the brainCloud setting tab:

  • Run the game, fill in the [User Name] and [Password] input fields with any words you prefer, and click the Authenticate button, you will see the success return like below.

  • Click the Enable RTT button from your Unity app, you should see the return as below with RTT connect success info.

  • Fill [Global channel code] field with the value "main" ( note: The full channel code looks like this “12020:gl:main” which is made in the button function. "12020" is your appId, "gl" represents a global channel, "main" is the global channel code.), click the Connect to Channel ID button. You will see the return info as below: (note: if you posted messages to this channel before, you will get a list of messages, otherwise, you won't see any messages here)

  • In order to post a message you will need to fill both Title and Message fields under the "Post Message" title. Once you post the message you will only get a debug log saying the post has been successful. You must connect to channel to see the messages associated with that channel.

  • Once a message is posted, click the Connect to Channel ID button to view all the messages in this channel in JSON format.

  • You can go-ahead to create a dynamic channel and test with it. Just make sure both users from Unity and portal are connected to the same channel.

Did this answer your question?