Skip to main content

Manage system inbox notifications

Last updated on January 31, 2024

Overview

The AccelByte Gaming Services (AGS) System Inbox Notifications feature enables you to send persistent system notifications to players' inboxes. Examples of system inbox notifications you can send include in-game news, in-game mail, a gift, a redeem code, penalty notifications, player report notifications, maintenance schedule, current event, and many more.

You can also delete or unsend any notifications from a player's inbox, if necessary.

Prerequisites

PermissionsActionUsage
ADMIN:NAMESPACE:{namespace}:CHAT:INBOXCREATE, READ, UPDATE, DELETETo create, query, edit and remove notifications.
ADMIN:NAMESPACE:{namespace}:CHAT:INBOXCREATE, READ, UPDATE, DELETETo create system message.

Access the system messages page

  1. Log in to the AGS Admin Portal.

  2. Go to the game namespace.

  3. On the sidebar, select Chat, then select System Messages.

    Image shows how to access System Messages

Manage system inbox notifications

Create and send a notification

  1. On the System Messages page, click on + Create New button.

  2. Fill in the fields with the required information to create the notification.

  3. Click the Create and Send button to send the message right away.

Create a draft notification

  1. On the System Messages page, click on + Create New button.

  2. Fill in the fields with the required information to create the notification.

  3. Click Save as Draft to save the notification as a draft and send it at a later time.

Unsend a notification

  1. On the System Messages page, find the sent notification you want to unsend.

    tip

    You can set the Status filter to Sent to only display sent notifications in the list.

  2. Click the notification's ellipsis menu, then select Unsend.

  3. Click Confirm, then click the Unsend button.

View, edit, and send draft notifications

  1. On the System Messages page, find the draft notification you want to view or edit.

  2. Click the View button of the notification to open.

  3. Click on the pencil button to start editing.

  4. Click Send Notification to send the notification right away.

Integrate system inbox notification into the game client

The example below shows you how to integrate system inbox notification into the game client:

// Create API client, login, and connect to Chat
FApiClientPtr ApiClient = FMultiRegistry::GetApiClient(TEXT("0"));
ApiClient->User.LoginWithUsername(TEXT("user+a@example.com"), TEXT("Password321"),
FVoidHandler::CreateLambda([]()
{
UE_LOG(LogTemp, Log, TEXT("Login User A successful"));
}),
FErrorHandler::CreateLambda([](int Code, FString const& Message)
{
UE_LOG(LogTemp, Log, TEXT("Login User A failed"));
}));
ApiClient->Chat.Connect();
// Set delegate for incoming system message notification
ApiClient->Chat.SetSystemMessageNotifDelegate(
Api::Chat::FSystemMessageNotif::CreateLambda([](const FAccelByteModelsChatSystemMessageNotif&
Notif)
{
UE_LOG(LogTemp, Log, TEXT("Got System Message: %s %s %s"), *Notif.MessageId, *Notif.Message,
*Notif.Category);
}));
// Query system message
{
FAccelByteModelsQuerySystemMessagesResponse Result;
Chat::FQuerySystemMessageResponse OnSuccess = Chat::FQuerySystemMessageResponse::CreateLambda(
[&Result](const FAccelByteModelsQuerySystemMessagesResponse& Response)
{
Result = Response;
});
FErrorHandler OnError = FErrorHandler::CreateLambda([](int32 Code, const FString& Message)
{
UE_LOG(LogTemp, Error, TEXT("Failed query chat system message %d, %s"), Code, *Message);
});
ApiClient->Chat.QuerySystemMessage(OnSuccess, OnError);
}
// Update system message (mark read/unread or keep messages)
{
FAccelByteModelsActionUpdateSystemMessage Action;
Action.ID = TEXT("message-id");
Action.Read = EAccelByteOptionalBool::NO; // mark message as unread
Action.Keep = EAccelByteOptionalBool::YES; // mark message to keep in inbox
Chat::FUpdateSystemMessagesResponse OnSuccess =
Chat::FUpdateSystemMessagesResponse::CreateLambda(
[](const FAccelByteModelsUpdateSystemMessagesResponse& Response)
{
UE_LOG(LogTemp, Log, TEXT("Update system message success"));
});
FErrorHandler OnError = FErrorHandler::CreateLambda([](int32 Code, const FString& Message)
{
UE_LOG(LogTemp, Error, TEXT("Failed update chat system message %d, %s"), Code, *Message);
});
ApiClient->Chat.UpdateSystemMessages({Action}, OnSuccess, OnError);
}
// Delete system message
{
Chat::FDeleteSystemMessagesResponse OnSuccess =
Chat::FDeleteSystemMessagesResponse::CreateLambda(
[](const FAccelByteModelsDeleteSystemMessagesResponse& Response)
{
UE_LOG(LogTemp, Log, TEXT("Delete system message success"));
});
FErrorHandler OnError = FErrorHandler::CreateLambda([](int32 Code, const FString& Message)
{
UE_LOG(LogTemp, Error, TEXT("Failed delete chat system message %d, %s"), Code, *Message);
});
ApiClient->Chat.DeleteSystemMessages({TEXT("message-id")}, OnSuccess, OnError);
}
// Get system message stats
{
FAccelByteGetSystemMessageStatsResponse Result;
Chat::FGetSystemMessageStatsResponse OnSuccess =
Chat::FGetSystemMessageStatsResponse::CreateLambda(
[&Result](const FAccelByteGetSystemMessageStatsResponse& Response)
{
Result = Response;
});
FErrorHandler OnError = FErrorHandler::CreateLambda([](int32 Code, const FString& Message)
{
UE_LOG(LogAccelByteChatTest, Error, TEXT("Failed get system message stats %d,
%s"), Code, *Message);
});
ApiClient->Chat.GetSystemMessageStats(OnSuccess, OnError);
}