Skip to main content

Installation and environment configuration

Download SDK

Supported Platforms
  • Android, iOS, Windows, Mac, Linux
Unreal Engine 4.27

Enable chat

The following details the method to enable chat in the console:

1. Connect to the console.

2. Click Channel, Reports and Restrictions, or Settings under Chat.

3. Click the Enable Chat button.

Create chat channel

You can create a chat channel via Chat -> Channel in the console.

1. Click Channel.

2. Create channel groups and channels

  1. Click the + button next to Channel Groups.

  1. Enter the channel group name and the maximum number of users per channel. Then, select a FALLBACK channel and click Next.

  1. Enter the name of the first channel and click the Create button.

Installation and environment configuration

The following shows how to download the Chat SDK and configure the project in Unreal Engine:

  1. Go to the folder where the project is saved.
  2. Unzip the downloaded SDK file in the Plugins folder. (If there is no Plugins folder, create one.)
  3. Execute Unreal Engine and check Edit -> Plugins -> Other.
  4. Confirm the checkbox to see if the plugin has been applied.

Changing to custom authentication and checking the chat server key

Go to BACKND Console > Chat > Settings tab and change the user authentication method to use custom authentication.
Please refer to the Custom Authentication documentation for details on the settings.

Then, check the chat server key (Chat UUID) to enter in Unreal.

Chat Client

Description

To receive changes and messages, you must implement certain callback methods in the application. It is defined with the BackndChat::IBDChatClientListener interface.

Features

One of our Chat SDK's features is the automatic reconnection process. When a user's network is changed or leased, the reconnection process is executed automatically. Because of the automatic reconnection process, you do not have to manage the process separately if you call BackndChat::BDChatMain::Shutdown(); when closing the app after calling BackndChat::BDChatMain::Initialize(this, args); for the first time.

Example

// ChatClientManager.h

#include "BDChatMain.h"

class ChatClientManager : public BackndChat::IBDChatClientListener
{
public:
ChatClientManager();
virtual ~ChatClientManager();

public:
virtual void OnJoinChannel(BackndChat::ChannelInfo channelInfo) override;
virtual void OnLeaveChannel(BackndChat::ChannelInfo channelInfo) override;
virtual void OnJoinChannelPlayer(string channelGroup, string channelName, uint64_t channelNumber, string gamerName, string avatar) override;
virtual void OnLeaveChannelPlayer(string channelGroup, string channelName, uint64_t channelNumber, string gamerName, string avatar) override;
virtual void OnChatMessage(BackndChat::MessageInfo messageInfo) override;
virtual void OnWhisperMessage(BackndChat::WhisperMessageInfo messageInfo) override;
virtual void OnTranslateMessage(std::vector<BackndChat::MessageInfo> messages) override;
virtual void OnHideMessage(BackndChat::MessageInfo messageInfo) override;
virtual void OnDeleteMessage(BackndChat::MessageInfo messageInfo) override;
virtual void OnSuccess(BackndChat::SUCCESS_MESSAGE success, void* param) override;
virtual void OnError(BackndChat::ERROR_MESSAGE error, void* param) override;
}

// ChatClientManager.cpp

#include "ChatClientManager.h"

ChatClientManager::ChatClientManager()
{
BackndChat::BDChatClientArguments args;
args.UUID = "xxxx-xxxx-xxxxxx-xxxxxxx";
args.CustomAccessToken = USER_TOKEN
args.Avatar = "default";
args.Metadata = "{}";

BackndChat::BDChatMain::Initialize(this, args);
}

ChatClientManager::~ChatClientManager()
{
BackndChat::BDChatMain::Shutdown();
}

void ChatClientManager::OnJoinChannel(BackndChat::ChannelInfo channelInfo) { }

void ChatClientManager::OnLeaveChannel(BackndChat::ChannelInfo channelInfo) { }

void ChatClientManager::OnJoinChannelPlayer(string channelGroup, string channelName, uint64_t channelNumber, string gamerName, string avatar) { }

void ChatClientManager::OnLeaveChannelPlayer(string channelGroup, string channelName, uint64_t channelNumber, string gamerName, string avatar) { }

void ChatClientManager::OnChatMessage(BackndChat::MessageInfo messageInfo) { }

void ChatClientManager::OnWhisperMessage(BackndChat::WhisperMessageInfo messageInfo) { }

void ChatClientManager::OnTranslateMessage(std::vector<BackndChat::MessageInfo> messages) { }

void ChatClientManager::OnHideMessage(BackndChat::MessageInfo messageInfo) { }

void ChatClientManager::OnDeleteMessage(BackndChat::MessageInfo messageInfo) { }

void ChatClientManager::OnSuccess(BackndChat::SUCCESS_MESSAGE success, void* param)
{
switch(success)
{
default:
break;
}
}

void ChatClientManager::OnError(BackndChat::ERROR_MESSAGE error, void* param)
{
switch(error)
{
default:
break;
}
}

void ChatClientManager::Tick(float DeltaTime)
{
BackndChat::BDChatMain::Update();
}