Broadcasts

Note

Stability: 3 - Stable

Overview

The Broadcasts service allows you to send pre-scheduled messages to your users through Hydra. One typical use case for this service is a “Message of the Day”, where players are presented with a scheduled message regarding important information (e.g. “new DLC available in the app store”). This broadcast functionality can be applied in other ways as well, such as providing your game with updated data on a preset schedule.

Channels

Broadcast channels help you logically organize your broadcasts. For example, you may send daily “beginner tips” to your new users, while sending upcoming league tournament information to your pro players. Broadcast channels can be used in innumerable other ways as well: get creative!

Creating & Editing

All Broadcast Channels are configurable within the Hydra developer dashboard. From the dashboard:

  1. Select the Project and Environment that you would like to set up the channel for.
  2. Select Broadcasts from the left sidebar (under Environment Config).
  3. Click the “Create new broadcast channel...” button. You are then presented with a list of options that you’ll need to configure.
  4. Once you save the channel, it will be available for use.
  5. At any time, you can return to the Broadcasts page (steps 1 & 2 above) to edit an existing channel. Click the edit button next to the channel you want to change, and make your adjustments.

Configuration

You need to configure basic information for each Broadcast Channel:

Name :
The name of your channel.
Slug :
Human-readable unique identifier for your channel. The slug will be pre-populated for you based on your channel name, but can also be edited at time of creation. A slug cannot be edited after creation.

Retrieving

Once your channels are created, you can retrieve them to use in your game.

Reference: C++ | REST

Broadcasts

All Broadcasts are configurable within the Hydra developer dashboard.

Each broadcast channel is composed of a number of broadcasts. To view the broadcasts assigned to a given channel, from the dashboard:

  1. Select the Project and Environment that you would like to set up the message for.
  2. Select Broadcasts from the left sidebar (under Environment Config).
  3. This will display a list of the channels you have configured in your environment. There are quick links to view broadcasts that are active or upcoming, broadcasts that have expired, or a “date range” view that will let you see what messages will be active during a specific range of dates.

Creating & Editing

To create or edit an existing broadcast, click on any of the three list views presented above.

  1. Once you are on the channel page, you will see a listing of the broadcasts, links leading to the other available views, and a button labeled “Add a broadcast”. Click this button to be taken to the broadcast form.
  2. At any time, you can click on other broadcasts to edit them.

Configuration

We provide a number of configurable options for each Broadcast:

Name :
The name of this broadcast.
Slug :
Human-readable unique identifier for the broadcast. The slug will be pre-populated for you based on your title, but can also be edited at time of creation. A slug cannot be edited after creation.
Content :
The primary content of the broadcast. This is typically text that is displayed to users.
Broadcast metadata :
Optional, free-form JSON data.
Start time / End time :
The duration of your broadcast.
Deliver broadcast via push notification :
If checked, Hydra will send out a notification when the broadcast starts. You can specify any or all of the three delivery channels for push notification.

Additionally, Hydra now offers a recurring broadcast type, selectable via a drop-down option on the broadcast form. Creating a recurring broadcast presents several other options to you:

Time of day :
Configures when your broadcast will be active on a day in which it recurs.
Repeat options :
You have detailed, fine-grained control over the specifics of repeating events, similar to what you may be familiar with from using a calendar application. Various frequencies are available from daily to yearly, and you can target specific months, dates, or days of the week within those categories.
Start and end dates :
These options constrain the window of time during which Hydra will calculate recurrences of the broadcast. You must specify a start date, but an end date is optional.
User segment restrictions :
If you have any user segments defined you can restrict access to the broadcast to one or more segments. Users outside selected segments will not receive push notifications for the broadcast and will not see them as BroadcastMessages within a Channel.

Push notifications can be configured for recurring broadcasts as well; Hydra will recalculate the next needed push notification time automatically.

Retrieving

After creating your broadcasts you can retrieve them to display to your users. We distinguish between the configuration data for a Broadcast which is not intended for distribution to clients, and the client-facing representations of the Broadcast or recurrences of a Broadcast at a specific time. This client-facing representation we refer to as a BroadcastMessage.

Use the timeline endpoint to retrieve current BroadcastMessages, including instances of recurring broadcasts, for display to your users. BroadcastMessage JSON looks like this:

{
    "broadcast": {
        "name": "My Recurring Broadcast",
        "slug": "my-recurring-broadcast"
    },
    "broadcast_channel_slug": "messages-channel",
    "broadcast_slug": "my-recurring-broadcast",
    "content": "Good Morning",
    "data": {},
    "end_at": "2016-05-17T21:30:00",
    "id": "2016-05-17T12:20:00",
    "start_at": "2016-05-17T12:20:00"
}

Broadcasts that have an earlier start datetime will be listed before broadcasts that have a later start datetime. Up to 30 messages will be retrieved in a single request. If needed, a cursor will be returned which can be used to navigate forward through the timeline’s message list.

Reference: C++

Notifications

Message Started

Triggered when a Broadcast Message has started. (Notifications for broadcast messages are processed in batches by Hydra Studio every 5 minutes, so there may be a delay up to 5 minutes between a Broadcast Message starting and players receiving the “Message Started” notification.)

This notification exposes:

Broadcast Channel :
The Broadcast Channel object for this message. Note, this object may not be fully loaded.
Broadcast Message :
The Broadcast Message object for the message that started. Note, this object may not be fully loaded.
Message Text :
The content of the message that has started.

Reference: C++

Table Of Contents

Previous topic

Realtime Networking

Next topic

Notifications