Skip to content
  • Our Product
    • Namazu Elements
      • What is Elements?
      • Why open source?
      • Docs
        • Namazu Elements in Five Minutes or Less
        • RESTful APIs Library
        • Security Model
        • Accessing the Web UI (CMS)

    Our Product

    A logomark with three layered rhombuses adorning the lettermark that says Elements in bold all-caps sans-serif letters.
    • What is Namazu Elements? Discover our easy-to-use backend network solution built for online games. Rapidly enables full-scale multiplayer games or online solo adventures.
    • Why open source? Is there a truly open source server backend for connected games? There is now. Download and run a local copy of Namazu Elements and try it for yourself.
    Download Namazu Elements

    Get started

    • Quick start Read our Elements 5-minute quick start guide
    • Documentation Read our developer docs for learning more about Elements
    • RESTful APIs A full list of core API specs for working with the Elements framework
    • Security An overview of the server-authoritative security model of Elements
    • Accessing the CMS Manage your game with ease via the Namazu Elements CMS.

    Co-development Reimagined

    • Best real-time game backends in 2026 If you're researching an alternative to your current backend solution, we've prepared a report of all of the backend solutions on the market in 2026 and how Namazu Elements compares.
      Co-dev

    Recent Posts

    • The watercolor-styled Namazu Studios logo over a giant namazu lurking in the depth
      Namazu Studios Featured in San Diego Business Journal
      22 Sep 2025 Press
    • Namazu Elements 3.1 Released – Service Layer Fixes, Secure APIs, and Steam Bug Fix
      22 Apr 2025 Release Notes
  • Case Studies
  • About Us
  • News
  • Services
  • Book a call
namazu-studios-logo
Book a call
Popular Search Roblox

Getting Started

  • Namazu Elements in Five Minutes or Less
  • Overview
  • Accessing the Web UI (CMS)
  • CMS Feature Overview

Fundamentals

  • Why You Need a Server (and What “Authoritative” Means)
  • Elements as a Game Runtime
  • Where Your Authoritative Code Runs
  • Lifecycles and Flows

General Concepts

  • Custom Elements
  • Data Models
  • Security Model
  • N-Tier Architecture

Namazu Elements Core Features

  • Email Service
  • Applications
  • Sessions
  • Users and Profiles
  • Digital Goods
  • Progress and Missions
  • Progress and Missions (3.4+)
  • Leaderboards
  • Matchmaking – Comprehensive Guide
  • Friends
  • Followers
  • Product Bundles and SKUs
  • Item Ledger
  • Receipts
  • Reward Issuances
  • Save Data
  • Metadata
  • Metadata (3.4+)
  • Queries
  • Application CDN Git Deployment
  • Large Object API
  • Firebase Push Notifications
  • Email Templates
  • Event Reference
  • Element Static Content and Dashboard UI Plugins
  • User Authentication / Sign In
    • What is a User?
    • Email Verification
    • User Authentication in Elements
    • Account Linking
    • Setting Up Twitch OIDC Login (Backend)
    • OIDC Login for Thick Clients (Browser Redirect Flow)
    • Auth Schemes
      • Auth Schemes
      • OAuth2
      • OIDC
  • Features
    • Web3
      • Wallets
      • Vaults
      • Omni Chain Support
      • Smart Contracts
        • Smart Contracts
  • Queries
    • Advanced Operators
    • Object Graph Navigation
    • Boolean Queries
    • Base Query Syntax
  • Advanced Operators
    • .name
    • .ref

Your Game Code - Adding Custom Elements

  • Custom Code Overview
  • Windows Setup
  • Mac OS Setup
  • Ubuntu Linux Setup
  • Element Anatomy: A Technical Deep Dive
  • Introduction to Guice and Jakarta in Elements
  • Structuring your Element
  • Events
  • Packaging an Element with Maven
  • Deploying an Element
  • Preparing for code generation
  • Properties
  • Websockets
  • RESTful APIs
  • Direct MongoDB Access (3.5+)
  • Building the Example Element: A Complete Walkthrough
  • Building the Kotlin Example Element: A Complete Walkthrough

Configuration

  • Configuring External URLs for Deployment
  • Matchmaking – Comprehensive Guide
  • Direct Database Access and Batch Configuration
  • Connecting Namazu Elements to a TLS-Enabled MongoDB Replica Set
  • Batch Samples
    • Mission Upload Bash Script Sample
    • Item Upload Bash Script Sample

RESTful APIs

  • Importing into Postman
  • RESTful APIs Library
  • Swagger and Swagger UI

Add-Ons

  • Crossplay
    • Crossfire Client Libraries (JVM & Browser)
    • Crossfire Protocol Reference
    • Crossfire: Custom Matchmaking Algorithms
    • Namazu Crossfire (Multiplayer)
    • Deploying Namazu Crossfire in your game
  • Roblox
    • Roblox Overview
    • Secure Player Authentication & Registration
    • Global Matchmaking
    • Roblox Security Best Practices
  • Container on Demand
    • Namazu Conductor
    • Namazu Conductor Admin API
    • Configuring Namazu Conductor Providers
    • Streaming Job Stdio in Namazu Conductor
  • Commerce
    • Stripe
      • Stripe
      • Configuring the Stripe Element
      • Stripe REST API Reference
      • Stripe REST API Reference
      • Stripe Webhooks and the Typed Event Bus

Game Engine & Client Support

  • Unity
    • Elements Unity Plugin
    • Unity Crossfire Plugin
  • Gamemaker
    • Incorporating GMEXT-Elements into a GameMaker Project

Troubleshooting

  • Common Issues with Docker
  • Local SDK
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Could not load class : java.lang.NoClassDefFoundError
  • Namazu Elements Community Edition
    • Common Issues with Docker
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Running in the IDE
      • Exception in monitor thread while connecting to server localhost:27017
      • Could not deployAvailableApplications Jetty server Failed to bind to /0.0.0.0:8080 Address already in use

Releases

  • Release Process (3.9+)
  • 3.8 Release Notes
  • 3.9 Release Notes
  • 3.7 Release Notes
  • 3.6 Release Notes
  • 3.5 Release Notes
  • 3.4 Release Notes
  • 3.3 Release Notes
  • 3.2 Release Notes
  • 3.1 Release Notes

Namazu Agent

  • Namazu Agent Overview
  • Common Agent Tasks
  • Tips for Using the Namazu Agent

Namazu Cloud

  • Namazu Cloud Overview
  • Namazu Cloud Organizations
  • Namazu Cloud Subdomains
  • Namazu Cloud Instances
  • Namazu Cloud Products and SKUs
  • Namazu Cloud Add-ons
  • Namazu Cloud Account
  • Namazu Cloud Backups
  • Namazu Cloud Billing
View Categories
  • Home
  • Docs
  • Namazu Elements Core Features
  • Firebase Push Notifications

Firebase Push Notifications

Est. read time: 3 min read

0:00 / 4:35
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)
AI Doc Summarizer Doc Summary
AI Doc Summarizer Thinking Thinking

Namazu Elements includes a full server-side push notification system built on the Firebase Admin SDK. It has three parts: a per-Application Firebase configuration, a device registration token stored per Profile, and a general-purpose notification-sending API that your own server-side code calls to actually deliver a push. There is no REST endpoint for triggering a send; sending is meant to be driven by your own business logic, typically from a Custom Element. See Custom Elements if you haven’t built one yet.

Configuring Firebase for an Application #

Firebase credentials are configured per Application, as one of that Application’s Application Configurations, alongside things like IAP platform and matchmaking configuration. There is no server-wide Firebase configuration; each Application that wants to send push notifications needs its own.

FieldDescription
projectIdThe Firebase project id.
serviceAccountCredentialsThe full JSON contents of a Firebase Service account key file (not a file path). This is the same file you’d generate from Firebase Console under Project Settings > Service Accounts > Generate New Private Key.
MethodPathDescription
POST/Application/{applicationNameOrId}/configuration/firebaseCreates the Application’s Firebase configuration.
GET/Application/{applicationNameOrId}/configuration/firebase/{applicationConfigurationNameOrId}Gets a Firebase configuration.
PUT/Application/{applicationNameOrId}/configuration/firebase/{applicationConfigurationNameOrId}Updates a Firebase configuration.
DELETE/Application/{applicationNameOrId}/configuration/firebase/{applicationConfigurationNameOrId}Deletes a Firebase configuration.

Managing an Application’s Firebase configuration is Superuser-only; there is no User or Anonymous access to this endpoint. If an Application has no Firebase configuration attached, attempting to send a notification through it fails with a configuration error rather than silently doing nothing.

Registering a Device Token #

Once a client obtains a Firebase registration token (via the Firebase client SDK on the device), it registers that token with Elements against the current Profile:

MethodPathDescription
POST/notification/fcmRegisters a Firebase token for a Profile.
PUT/notification/fcm/{fcmRegistrationId}Updates an existing registration (typically to refresh a rotated token).
DELETE/notification/fcm/{fcmRegistrationId}Removes a registration (e.g. on sign-out or uninstall).

A registration is just an id, a registrationToken, and the owning Profile. Each Profile can hold only one stored registration at a time; registering a new token for a Profile that already has one replaces it rather than adding a second device.

As a normal User, you can only manage the registration for your own current Profile: if you omit Profile in the request body it defaults to your current Profile, and if you supply one that isn’t yours, the request is rejected. A Superuser can create, update, or delete a registration for any Profile. Anonymous callers cannot use this endpoint at all.

Sending a Notification #

There is no REST endpoint to send a push notification. Sending is done programmatically, by injecting NotificationService into your own Custom Element and building a notification with its fluent builder:

☕
Copy
@Inject
private NotificationService notificationService;

public void notifyPlayer(Profile recipient) {
    notificationService
        .getBuilder()
        .recipient(recipient)
        .title("Your turn!")
        .message("It's your move in Match #482.")
        .sound()
        .add("matchId", "482")
        .build()
        .send();
}

The builder exposes:

  • recipient(Profile) – the Profile to notify. Elements looks up that Profile’s registered token(s) to determine where to actually deliver the push.
  • sender(Profile) / Application(Application) – which Application’s Firebase configuration to send under. If you set a sender Profile, its owning Application is used automatically; you rarely need to call Application(...) directly.
  • title(String) / message(String) – the notification’s title and body text.
  • sound() / sound(String) – enables a notification sound, defaulting to "default", or a specific named sound.
  • add(key, value) / addAll(Map) – a custom string key/value data payload delivered alongside the notification, for your client code to act on (e.g. deep-linking to a specific screen).

build() throws a configuration exception if the target Application has no Firebase configuration attached. send() returns the number of destinations notified, and has an overload that takes success/failure callbacks per destination:

int notified = notificationService
    .getBuilder()
    .recipient(recipient)
    .title("Your turn!")
    .message("It's your move in Match #482.")
    .build()
    .send(
        event -> logger.info("Delivered to token {}", event.getTokenId()),
        error -> logger.warn("Delivery failed", error)
    );

Under the hood, each call sends a single, direct-to-device Firebase message per registered token for the recipient (there’s no topic broadcast or multicast batching). Android and iOS-specific notification fields are populated automatically from title/message/sound, so you don’t need to build platform-specific payloads yourself.

Error Handling #

If Firebase reports a token as unregistered (the device uninstalled the app, or the token otherwise expired), Elements automatically deletes that Profile’s stored registration so you don’t keep sending to a dead token. Any other delivery failure (network error, malformed payload, and so on) is only reported to the failure callback you supply; there is no built-in retry or backoff, so retry logic is your Element’s responsibility if you need it.

Events #

Registering, updating, and deleting an FCM registration each publish an event your Element can subscribe to (registration created, updated, and deleted), the same way most other data types in Elements do. See Events. Sending a notification itself does not publish an event; use the success/failure callbacks on send(...) if you need to react to delivery outcomes.

What are your Feelings
Still stuck? How can we help?

How can we help?

Updated on September 23, 2026
Large Object APIEmail Templates
Table of Contents
  • Configuring Firebase for an Application
  • Registering a Device Token
  • Sending a Notification
  • Error Handling
  • Events
  • Documentation
  • Terms of Service
  • Privacy Policy
  • Contact us
  • Linkedin
  • Join our Discord

Namazu Studios LLC is powered by Namazu Elements, an open source modular backend framework for connected games.

Namazu Elements
  • Download
  • About Elements
  • Open source
  • Documentation
  • Support
Namazu Studios
  • Case Studies
  • About Us
  • News
Best realtime game backends 2026
Get in Touch
  • info@namazustudios.com
  • Book a call
  • (619) 862-2890
  • Linkedin
  • Discord

©2008-2026 Namazu Studios. All Rights Reserved.