نظرة عامة حول تصميم خدمة "المراسلة عبر السحابة الإلكترونية من Firebase"
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعتمد خدمة FCM على مجموعة المكوّنات التالية التي تنشئ الرسائل وتنقلها وتتلقّاها:
أدوات لإنشاء طلبات الرسائل أو إنشائها توفّر أداة إنشاء الإشعارات خيارًا مستندًا إلى واجهة المستخدم الرسومية لإنشاء طلبات الإشعارات.
للحصول على التشغيل الآلي الكامل وإتاحة جميع أنواع الرسائل، يجب إنشاء طلبات الرسائل في بيئة خادم موثوقة تتوافق مع حزمة تطوير البرامج (SDK) الخاصة بخدمة Firebase Admin أو بروتوكول خادم FCM.
يمكن أن تكون هذه البيئة هي "وظائف السحابة الإلكترونية لبرنامج Firebase" (Cloud Functions for Firebase) أو App Engine أو خادم التطبيق الخاص بك.

تتلقّى الخلفية الإدارية لخدمة FCM طلبات الرسائل (من بين وظائف أخرى)، وتنفّذ عملية توزيع الرسائل على نطاق واسع من خلال المواضيع، وتنشئ البيانات الوصفية للرسائل، مثل معرّف الرسالة.
طبقة نقل على مستوى النظام الأساسي، تعمل على توجيه الرسالة إلى الجهاز المستهدَف، وتتولّى عملية تسليم الرسالة، وتطبّق الإعدادات الخاصة بالنظام الأساسي عند الاقتضاء. تتضمّن طبقة النقل ما يلي:
حزمة تطوير البرامج (SDK) الخاصة بخدمة "المراسلة عبر السحابة الإلكترونية من Firebase" على جهاز المستخدم، حيث يتم عرض الإشعار أو معالجة الرسالة وفقًا لحالة التطبيق (في المقدّمة أو الخلفية) وأي منطق تطبيق ذي صلة
مسار مراحل النشاط
- تسجيل الأجهزة لتلقّي الرسائل من ميزة "المراسلة عبر السحابة الإلكترونية من Firebase" يسجّل مثيل أحد تطبيقات العميل لتلقّي الرسائل، ويحصل على رمز تسجيل يحدّد مثيل التطبيق بشكلٍ فريد.
- إرسال الرسائل إلى الأجهزة وتلقّيها
- إرسال رسالة. يرسل خادم التطبيق رسائل إلى تطبيق العميل:
- يتم إنشاء الرسالة، إما في أداة إنشاء الإشعارات أو في بيئة موثوق بها، ويتم إرسال طلب رسالة إلى الخلفية في "المراسلة من خلال السحابة الإلكترونية من Firebase".
- يتلقّى الخلفية الإدارية لخدمة FCM طلب الرسالة، وينشئ معرّف رسالة وبيانات وصفية أخرى، ثم يرسلها إلى طبقة النقل الخاصة بالنظام الأساسي.
- عندما يكون الجهاز متصلاً بالإنترنت، يتم إرسال الرسالة عبر طبقة النقل الخاصة بالمنصة إلى الجهاز.
- يتلقّى تطبيق العميل الرسالة أو الإشعار على الجهاز.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-16 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-16 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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."]]