Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bạn có thể gửi thông báo bằng
Notifications composer (Trình soạn thảo thông báo) trong bảng điều khiển Firebase. Mặc dù không mang lại tính linh hoạt hoặc khả năng mở rộng như khi gửi thông báo bằng Admin SDK hoặc giao thức HTTP phiên bản 1, nhưng phương thức này có thể rất hữu ích cho việc kiểm thử hoặc cho hoạt động tiếp thị và tương tác với người dùng có độ nhắm mục tiêu cao.
Bảng điều khiển Firebase cung cấp thử nghiệm A/B dựa trên số liệu phân tích để giúp tinh chỉnh và cải thiện thông điệp tiếp thị.
Sau khi phát triển logic trong ứng dụng để nhận tin nhắn, bạn có thể cho phép người dùng không chuyên về kỹ thuật gửi tin nhắn bằng trình soạn thông báo.
Giới thiệu
Khi bạn gửi một thông báo từ
Trình soạn thông báo, Google sẽ sử dụng các giá trị mà bạn nhập vào các trường biểu mẫu theo những cách sau:
Các trường như Phân khúc người dùng và Hết hạn xác định mục tiêu của thông báo và các lựa chọn phân phối.
Các trường như Văn bản thông báo và Dữ liệu tuỳ chỉnh được gửi đến ứng dụng khách trong một tải trọng bao gồm các cặp khoá/giá trị.
Các trường này liên kết với các khoá có sẵn thông qua đối tượng Message. Ví dụ: các cặp khoá/giá trị được nhập vào trường Dữ liệu tuỳ chỉnh của trình soạn thảo sẽ được xử lý dưới dạng tải trọng data cho thông báo. Các trường khác liên kết trực tiếp với các khoá trong đối tượng notification hoặc trong cấu hình thông báo dành riêng cho nền tảng.
Xin lưu ý rằng một số trường trong
Trình soạn thảo thông báokhông có sẵn thông qua API FCM. Ví dụ: bạn có thể nhắm đến các phân khúc người dùng dựa trên phiên bản ứng dụng, ngôn ngữ, loại và phiên bản trình duyệt hoặc thuộc tính người dùng theo những cách không có sẵn khi sử dụng API máy chủ.
Các khoá mà bảng điều khiển Firebase gửi đến các ứng dụng là:
Khóa
Nhãn trường trên bảng điều khiển
Mô tả
notification.title
Tiêu đề thông báo
Cho biết tiêu đề thông báo.
notification.body
Nội dung thông báo
Cho biết nội dung thông báo.
data
Dữ liệu tùy chỉnh
Cặp khoá/giá trị mà bạn xác định. Các thông báo này được gửi dưới dạng tải trọng dữ liệu để ứng dụng xử lý.
Các khoá xác định việc gửi thông báo bao gồm:
Khóa
Nhãn trường trên bảng điều khiển
Mô tả
sound
Âm thanh
Cho biết âm thanh sẽ phát khi thiết bị nhận được thông báo.
time_to_live
Hết hạn
Tham số này chỉ định khoảng thời gian (tính bằng giây) mà thông báo sẽ được lưu trữ trong bộ nhớ FCM nếu thiết bị không kết nối mạng.
Để biết thêm thông tin, hãy xem phần Đặt thời gian tồn tại của một thông báo.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-16 UTC."],[],[],null,["You can send notification messages using\n[the Notifications composer](//console.firebase.google.com/project/_/notification) in the Firebase console. Though this does not\nprovide the same flexibility or scalability as sending messages with the\n[Admin SDK](/docs/cloud-messaging/admin) or the\n[v1 HTTP protocol](/docs/reference/fcm/rest), it can be\nvery useful for testing or for highly targeted marketing and user engagement.\nThe Firebase console provides analytics-based\n[A/B testing](/docs/ab-testing/abtest-with-console) to help refine and\nimprove marketing messages.\n\nAfter you have developed logic in your app to receive messages, you can allow\nnon-technical users to send messages with\n[the Notifications composer](//console.firebase.google.com/project/_/notification).\n\nAbout\n\nWhen you send a notification message from\n[the Notifications composer](//console.firebase.google.com/project/_/notification),\nGoogle uses the values you enter in the form fields in these ways:\n\n- Fields like **User segment** and **Expires** determine the message target and delivery options.\n- Fields like **Notification text** and **Custom data** are sent to the client in a payload comprised of key/value pairs.\n\nThese fields map to keys available through the\n[`Message`](/docs/reference/fcm/rest/v1/projects.messages#resource:-message)\nobject. For example, key/value pairs entered in the **Custom data**\nfield of the composer are handled as a\n[`data`](/docs/reference/fcm/rest/v1/projects.messages#Message.FIELDS.data)\npayload for the notification. Other fields map directly to keys in the\n[`notification`](/docs/reference/fcm/rest/v1/projects.messages#notification)\nobject or in the platform specific notification configuration.\n\nNote that some fields in\n[the Notifications composer](//console.firebase.google.com/project/_/notification) are *not* available through\nthe FCM API. For example, you can target user segments\nbased on app version, language, browser type and version, or user properties\nin ways that are not available using the server API.\n| **Caution:** In another important difference from programmatic messaging, the console lets you cancel any scheduled message that is not already in progress. **Once\n| a message fanout is actually in progress, it is fully committed and\n| cannot be canceled through the console nor by Firebase support.**\n\nThe keys that the Firebase console sends to clients are:\n\n| Key | Console field label | Description |\n|----------------------|---------------------|-----------------------------------------------------------------------------------------------|\n| `notification.title` | Notification title | Indicates notification title. |\n| `notification.body` | Notification text | Indicates notification body text. |\n| `data` | Custom data | Key/value pairs that you define. These are delivered as a data payload for the app to handle. |\n\nKeys that determine message delivery include:\n\n| Key | Console field label | Description |\n|----------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sound` | Sound | Indicates a sound to play when the device receives a notification. |\n| `time_to_live` | Expires | This parameter specifies how long (in seconds) the message should be kept in FCM storage if the device is offline. For more information, see [Setting the lifespan of a message](/docs/cloud-messaging/concept-options#ttl). |"]]