با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
میتوانید پیامهای اعلان را با استفاده از سازنده Notifications در کنسول Firebase ارسال کنید. اگرچه این انعطاف پذیری یا مقیاس پذیری مشابه ارسال پیام با Admin SDK یا پروتکل HTTP v1 را ارائه نمی دهد، اما می تواند برای آزمایش یا برای بازاریابی بسیار هدفمند و تعامل کاربر بسیار مفید باشد. کنسول Firebaseتست A/B مبتنی بر تجزیه و تحلیل را برای کمک به اصلاح و بهبود پیام های بازاریابی ارائه می دهد.
پس از اینکه منطق برنامه خود را برای دریافت پیام ایجاد کردید، می توانید به کاربران غیر فنی اجازه دهید با سازنده Notifications پیام ارسال کنند.
درباره
وقتی یک پیام اعلان از سازنده Notifications ارسال میکنید، Google از مقادیری که در فیلدهای فرم وارد میکنید به این روشها استفاده میکند:
فیلدهایی مانند User segment و Expires گزینه های هدف و تحویل پیام را تعیین می کنند.
فیلدهایی مانند متن اعلان و دادههای سفارشی در یک محموله متشکل از جفتهای کلید/مقدار برای مشتری ارسال میشوند.
این فیلدها به کلیدهای موجود از طریق شی Message می شوند. برای مثال، جفتهای کلید/مقدار وارد شده در قسمت دادههای سفارشی آهنگساز بهعنوان محموله data برای اعلان استفاده میشوند. سایر فیلدها مستقیماً به کلیدهای موجود در شی notification یا در پیکربندی اعلان خاص پلت فرم نگاشت می شوند.
توجه داشته باشید که برخی از فیلدها در Notifications Composer از طریق FCM API در دسترس نیستند . برای مثال، میتوانید بخشهای کاربر را بر اساس نسخه برنامه، زبان، نوع و نسخه مرورگر یا ویژگیهای کاربر به روشهایی که با استفاده از API سرور در دسترس نیستند، هدفگیری کنید.
کلیدهایی که کنسول Firebase برای مشتریان ارسال می کند عبارتند از:
کلید
برچسب فیلد کنسول
توضیحات
notification.title
عنوان اطلاعیه
عنوان اعلان را نشان می دهد.
notification.body
متن اعلان
متن متن اعلان را نشان می دهد.
data
داده های سفارشی
جفت های کلید/مقدار که شما تعریف می کنید. اینها به عنوان یک محموله داده برای برنامه تحویل داده می شوند.
کلیدهایی که تحویل پیام را تعیین می کنند عبارتند از:
کلید
برچسب فیلد کنسول
توضیحات
sound
صدا
زمانی که دستگاه اعلان دریافت می کند، صدایی را برای پخش نشان می دهد.
time_to_live
منقضی می شود
این پارامتر مشخص می کند که در صورت آفلاین بودن دستگاه، چه مدت (بر حسب ثانیه) پیام باید در فضای ذخیره سازی FCM نگهداری شود. برای اطلاعات بیشتر، به تنظیم طول عمر پیام مراجعه کنید.
تاریخ آخرین بهروزرسانی 2025-08-22 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-22 بهوقت ساعت هماهنگ جهانی."],[],[],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). |"]]