> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwacks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Game Notifications

> Send messages to your players — in-app inbox, email, or push.

export const Scope = ({children}) => <Info>
    <b>Scope:</b> {children}
  </Info>;

**Game notifications** let you talk to your players: announce an event, celebrate a milestone,
win back a lapsed cohort. You author a message once as a **template**, send it with a
**campaign**, and players receive it on the **channels** you chose — the in-game inbox, email,
or push.

<Scope>templates and campaigns are defined per **game**; the inbox is per **player**.</Scope>

<Tabs>
  <Tab title="Dashboard">
    Notifications live under **Marketing**:

    * **Templates** — the reusable message: a title and body (with a locale), the channels it can
      go out on, and **variables** you fill in at send time — write the season-start announcement
      once with the season name as a variable, and reuse it every season.
    * **Campaigns** — an actual send: pick a template, fill its variables, choose the
      **audience** — every player, or a [segment](/guides/segments) — and send **now**, at a
      **scheduled** time, or on a **recurring** cadence. A scheduled campaign can be canceled
      any time before it goes out.
    * **Delivery Status** — how a send went: its lifecycle from scheduled through sending to
      sent, with per-channel delivery counts and any failures.
  </Tab>

  <Tab title="Unity">
    **The inbox.** Fetch the signed-in player's notifications, show an unread badge, and mark
    items read one at a time or all at once.

    ```csharp theme={null}
    PaginatedResponse<Notification> inbox = await FlockClient.Instance.Notification.GetInboxAsync();
    NotificationSummary summary = await FlockClient.Instance.Notification.GetSummaryAsync();
    Debug.Log($"{summary.UnreadCount} unread");

    await FlockClient.Instance.Notification.MarkReadAsync(inbox.Items[0]);
    await FlockClient.Instance.Notification.MarkAllReadAsync();
    ```

    `GetSummaryAsync` returns the unread count plus the newest few items, so a badge and a
    preview cost one call. Prefer it to refetching the whole inbox on a timer — inbox reads count
    toward your plan's API usage like any other SDK call.

    **Push.** How you get a device token depends on the platform, and the SDK is explicit about
    which half it can do for you:

    * **iOS** — `RegisterThisDeviceAsync()` asks the OS for notification permission and registers
      the resulting APNs token in one call. It requires `com.unity.mobile.notifications` in the
      project.
    * **Android** — fetch the FCM token from Firebase yourself, then pass it to
      `RegisterDeviceTokenAsync(token)`. The Firebase messaging client isn't installable over UPM,
      so the SDK cannot ship it as a dependency and deliberately doesn't try.
    * **Everywhere else** (desktop, console, Editor) — both calls throw, because the push backend
      has no value for those platforms.

    Re-register whenever the OS issues a new token. `UnregisterDeviceTokenAsync` removes one.

    **Reminders your game schedules itself.** Schedule a template to arrive later — "energy full
    in 4 hours" — and cancel it if the player comes back first.

    ```csharp theme={null}
    ScheduledNotification pending = await FlockClient.Instance.Notification.ScheduleAsync(
        "energy_refilled", TimeSpan.FromHours(4));

    await FlockClient.Instance.Notification.CancelScheduledAsync(pending);
    ```

    The first argument is the template's **name**, not its ID. Pass `variables` to fill the
    template's placeholders, `channels` to restrict delivery, and `locale` to pick a
    localisation. An unknown name throws `FlockErrorCode.NotificationTemplateNotFound` before
    anything is scheduled.

    **Reading the catalog.** `GetTemplatesAsync()` lists the templates your game can schedule and
    `GetTemplateByNameAsync(name, locale)` fetches one. Both are game-scoped rather than
    per-player, so unlike the rest of this provider they work signed out.

    **Reacting to arrivals.** `FlockEvents.OnNotificationReceived` fires once per notification the
    SDK hasn't surfaced before, oldest first. It rides the fetches your game already makes and
    adds no traffic — there is no realtime channel and the SDK deliberately does not poll.
  </Tab>
</Tabs>

<Note>
  This page is about messages **to players**. Alerts to your own team — error spikes, build
  results — are [Developer Alerts](/guides/developer-alerts).
</Note>

<Note>
  The notification SDK surface is available in the [Unity SDK](/sdk/unity). Unreal support is not
  yet available — campaigns you send from the dashboard still reach every player, since delivery
  is server-side; it's the in-game inbox and scheduling APIs that are Unity-only for now.
</Note>
