FCM Architectural Overview
Stay organized with collections
Save and categorize content based on your preferences.
FCM relies on the following set of components that build, transport, and receive
messages:
Tooling to compose or build message requests. The Notifications composer
provides a GUI-based option for creating notification requests.
For full automation and support for all
message types
,
you must build message requests in a trusted
server environment
that supports the Firebase Admin SDK or the FCM server protocol.
This environment could be Cloud Functions for Firebase, App Engine,
or your own app server.
The FCM backend, which (among other functions) accepts message requests,
performs fanout of messages via topics, and generates message metadata such
as the message ID.
A platform-level transport layer, which routes the message to the targeted
device, handles message delivery, and applies platform-specific
configuration where appropriate. This transport layer includes:
The FCM SDK on the user’s device, where the notification is displayed or
the message is handled according to the app’s foreground/background state
and any relevant application logic.
Lifecycle flow
- Register devices to receive messages from FCM
. An instance of a client app registers to receive messages, obtaining a registration token that uniquely identifies the app instance.
- Send and receive downstream messages
.
- Send a message. The app server sends messages to the client app:
- The message is composed, either in the Notifications composer or a trusted environment, and a message request is sent to the FCM backend.
- The FCM backend receives the message request, generates a message ID and other metadata, and sends it to the platform specific transport layer.
- When the device is online, the message is sent via the platform-specific transport layer to the device.
- On the device, the client app receives the message or notification.
Except as otherwise noted, the content of this page is licensed under the
Creative Commons Attribution 4.0 License
, and code samples are licensed under the
Apache 2.0 License
. For details, see the
Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-03 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]