Access
Connect cross-platform accounts & identity management
AccelByte Cloud’s Notification service enables administrators or publishers to send text-based notifications to players. Notifications can be sent from service to service or from service to the client application. Notifications are sent using REST API and are relayed through a WebSocket connection, to ensure that they've been received in real-time. The main features of our Notification service are listed below.
Permissions (opens new window) are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage notification in the Admin Portal.
Usage | Resource | Action |
Create a Notification Topic | ADMIN:NAMESPACE:{namespace}:NOTIFICATION | Create |
Send a Freeform Notification to a User | ADMIN:NAMESPACE:{namespace}:NOTIFICATION | Create |
Create a Notification Template | ADMIN:NAMESPACE:{namespace}:NOTIFICATION | Create |
Send a Templated Notification | ADMIN:NAMESPACE:{namespace}:NOTIFICATION | Create |
Permissions work slightly differently depending on whether they are assigned to IAM Clients (opens new window) or Roles (opens new window) assigned to users. For more information, read the Authentication and Authorization (opens new window) documentation.
The Admin Portal gives community managers and game admins an easy way to manage players’ notifications.
To create or maintain notification topics in the Admin Portal, follow the steps below.
In the Game Management section of the Admin Portal, go to the Push Notifications section and click the Topics menu. Then click the New Topic button to add a new topic.
The Add New Topic form will appear. Fill in the required fields as seen below.
The newly created topic will be visible in the Notification Topics panel. You can view and edit the topic by clicking the Edit button or delete the topic by clicking the Delete button.
By default, sending freeform notifications to individual players from the Admin Portal utilizes synchronous notification. This means that the targeted player must be online to retrieve the message. However, the broadcast feature does not require the player to be online as it sends the message to all players in a namespace, regardless of online status.
On the Template page of the Admin Portal, click the Send Freeform button.
In the Send Freeform window, select which type of user you are going to send the template to. If you select Single User, you need to input the target player’s User ID. If you select All User, the notification will be delivered to all players in the selected namespace.
Type Choose Single User or All User for sending a freeform notification. If you choose a single user, you need to input a specific user id from the player.
Topic You can choose any topic if you want. Topic is the one that you created before from the topic panel. it depends on your game logic to handle the notification.
Notification Message What message that you want to send to the player. It can be a new update message, new event message, banned user, and other stuff that depends on what your game logic is.
Once completed, click the Send button to send the notification template or click the Cancel button to cancel the process.
notification to either a single-player or to all players. To send a templated notification, create a template by following the steps below.
On the Templates page of the Admin Portal, click the New Template button.
Fill in the Add New Template form with the required fields.
Click the Add button. The newly created template will appear on the Notification Templates page.
On the Templates page, you can choose your newly created template and click the View button to open the Template Localization page.
Here you can create a draft of the notification message before you publish it.
After you have created a template for your notification, you are ready to send templated notifications to players.
On the Template page of the Admin Portal, click the Send Template button.
In the Send Template window, select which type of player you are going to send the notification to. If you select Single User, you need to input the player’s User ID. If you select All User, the notification will be delivered to all players in the selected namespace.
When you’re done, click the Send button to send the notification or click the Cancel button to cancel the process.
Notifications can be retrieved either synchronously or asynchronously.
To retrieve a synchronous notification using the SDK, you need to add the notification delegate.
You can also filter notifications by topic.
To retrieve an asynchronous notification, just call the get asynchronous function and all stored notifications will be sent to your notification delegate.
Before using the Notifications (opens new window) service from the SDK, you will need to initialize your server-side SDK to ensure you are authorized and able to perform create, read, update, and delete actions.
Before using the Notifications service from the Golang SDK, you will need to initialize the SDK by following the steps below:
Create your OAuth Client and assign the necessary permissions to access the IAM service.
Initialize the OAuth 2.0 service using the following function (opens new window):
Once completed, you can use the Golang SDK to create, read, update, and delete Notifications (opens new window) from your serverless app.
Before using the Notifications service from the Python SDK, you will need to initialize the SDK by following the steps below:
Once completed, you can use the Python SDK to create, read, update, and delete Notifications (opens new window) from your serverless app.
Use following .NET namespaces:
using AccelByte.Sdk.Api.Lobby;
using AccelByte.Sdk.Api.Lobby.WSModel;
The Lobby WebSocket service works slightly differently to other AccelByte services. Before using the Lobby WebSocket service, you will need to create a LobbyService object.
LobbyService lobby = new LobbyService(sdk.Configuration);
lobby.OnReceiveError = (eMessage) =>
{
is_error = true;
//handle if error occurs here
};
Once completed, you can connect and listen to the Lobby WebSocket service.
Task connectTask = lobby.Connect(false);
connectTask.Wait();
Task listenTask = Task.Run(() => lobby.Listen());
Before using the Lobby service, you will need to set some permissions. Initialize the Notification wrapper from the Lobby service using the following code:
Notification wLobbyNotification = new Notification(_sdk);
Once completed, you can use the SDK to create, read, update, or delete notifications or friends, or send and receive WebSocket formatted messages from your app.
Some of the features in the Notifications service use WebSocket to enable the connection. Make sure you've set up WebSocket using our CLI (opens new window). Once you've set up the CLI, you can use the GetNotificationMessage() (opens new window) wrapper to initialize the Notification service from the Lobby service.
Use the following function to send a freeform notification (opens new window):
Use the following function to receive a parsed websocket message from the server:
Use the following function to retrieve an offline notification:
Use the following function to send a party request message:
← Chat Storage Overview →