Ringkasan Arsitektur FCM
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
FCM mengandalkan serangkaian komponen berikut yang berfungsi untuk mem-build, memindahkan, dan menerima pesan:
Alat untuk menulis atau mem-build permintaan pesan. Notifications composer menyediakan opsi berbasis GUI untuk membuat permintaan notifikasi.
Untuk mendapatkan otomatisasi penuh dan dukungan bagi semua jenis pesan, Anda harus mem-build permintaan pesan di lingkungan server tepercaya yang mendukung Firebase Admin SDK atau protokol server FCM.
Lingkungan ini dapat berupa Cloud Functions for Firebase, App Engine, atau server aplikasi Anda sendiri.

Backend FCM, yang (di antara fungsi lainnya) menerima permintaan pesan, menjalankan fanout pesan melalui topik, dan menghasilkan metadata pesan seperti ID pesan.
Lapisan transportasi level platform, yang merutekan pesan ke perangkat target, menangani pengiriman pesan, dan menerapkan konfigurasi spesifik platform jika sesuai. Lapisan transportasi ini mencakup:
FCM SDK di perangkat pengguna, tempat notifikasi ditampilkan atau pesan ditangani sesuai dengan status latar depan/latar belakang aplikasi dan beragam logika aplikasi yang relevan.
Alur siklus proses
- Daftarkan perangkat untuk menerima pesan dari FCM. Instance aplikasi klien didaftarkan untuk menerima pesan, dan mendapatkan token pendaftaran yang mengidentifikasi instance aplikasi tersebut secara unik.
- Kirim dan terima pesan downstream.
- Kirim pesan. Server aplikasi mengirimkan pesan ke aplikasi klien:
- Pesan ditulis, baik di Notifications Composer atau di lingkungan tepercaya, dan permintaan pesan akan dikirim ke backend FCM.
- Backend FCM menerima permintaan pesan, membuat ID pesan dan metadata lainnya, lalu mengirimkannya ke lapisan transportasi spesifik platform.
- Saat perangkat sedang online, pesan akan dikirim ke perangkat melalui lapisan transportasi spesifik platform.
- Di perangkat tersebut, aplikasi klien akan menerima pesan atau notifikasi yang dimaksud.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-16 UTC.
[null,null,["Terakhir diperbarui pada 2025-08-16 UTC."],[],[],null,["\u003cbr /\u003e\n\nFCM relies on the following set of components that build, transport, and receive\nmessages:\n\n1. Tooling to compose or build message requests. The Notifications composer\n provides a GUI-based option for creating notification requests.\n For full automation and support for all\n [message types](https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages),\n you must build message requests in a trusted\n [server environment](https://firebase.google.com/docs/cloud-messaging/server)\n that supports the Firebase Admin SDK or the FCM server protocol.\n This environment could be Cloud Functions for Firebase, App Engine,\n or your own app server.\n\n2. The FCM backend, which (among other functions) accepts message requests,\n performs fanout of messages via topics, and generates message metadata such\n as the message ID.\n\n3. A platform-level transport layer, which routes the message to the targeted\n device, handles message delivery, and applies platform-specific\n configuration where appropriate. This transport layer includes:\n\n - Android transport layer (ATL) for Android devices with Google Play services\n - Apple Push Notification service (APNs) for Apple devices\n - Web push protocol for web apps\n\n | **Note:** Platform-level transport layers are outside the core FCM product. FCM messages routed to a platform-level transport layer may be subject to terms specific to that platform rather than FCM's terms of service. Android message routing via ATL falls under the [Google APIs terms of service](https://www.google.com/url?q=https://developers.google.com/terms/&sa=D&ust=1558536676246000&usg=AFQjCNFrlRMLv51d1S9NkWxD0IoYSqJ2Ng).\n4. The FCM SDK on the user's device, where the notification is displayed or\n the message is handled according to the app's foreground/background state\n and any relevant application logic.\n\nLifecycle flow\n\n- **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.\n- **Send and receive downstream messages** .\n - Send a message. The app server sends messages to the client app:\n 1. The message is composed, either in the Notifications composer or a trusted environment, and a message request is sent to the FCM backend.\n 2. The FCM backend receives the message request, generates a message ID and other metadata, and sends it to the platform specific transport layer.\n 3. When the device is online, the message is sent via the platform-specific transport layer to the device.\n 4. On the device, the client app receives the message or notification."]]