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

Config global chat channel

Jason Liang avatar
Written by Jason Liang
Updated over 8 months ago

As chat messages are transmitted to Pub/Sub topics (chat channels) rather than individual users, it is necessary to establish a topic (chat channel) prior to conducting Chat messages.

Pro Tips: The Chat Channels settings on this page have been specifically designed for global-type chat purposes.

Configs messaging service:

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

  • Assuming you already Enabled chat service for your app from the Design | Messaging | Chat page, if not, do it before starting the following steps.

  • Navigate to the Design | Messaging | Chat Channels page, click the [+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 example:

  • 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 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)

  • 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 the 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 the portal are connected to the same channel.

Did this answer your question?