شرحنا في الدورة الشاملة لمطور الاندرويد كيفية عمل تطبيق اندرويد مع الاشعارات هنا بعض قصاصات الكود ان شاء الله تفيدكم
<service android:name=".services.GreenFirebaseService"
android:enabled="true"
android:exported="true"
>
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".services.FirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<receiver
android:name="com.ahmadnaser.anbilarabi.services.BootReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
https://fcm.googleapis.com/fcm/send
Authorization:key=Legacy Key
Content-Type:application/json
{
"to": "/topics/global",
"collapse_key": "type_a",
"priority" : "high",
"data": {
"title": "Body of Your Notification in Data",
"message": "Title of Your Notification in Title",
"post_id": 59766,
"post_title": "Value for key_2"
}
}