diff --git a/backend/Admin/notifications/broadcast.php b/backend/Admin/notifications/broadcast.php index 0768b136..077554c3 100644 --- a/backend/Admin/notifications/broadcast.php +++ b/backend/Admin/notifications/broadcast.php @@ -76,7 +76,9 @@ if (function_exists('logAudit')) { } // الاستدعاء الداخلي لخدمة FCM -$fcmUrl = getenv('FCM_INTERNAL_URL') ?: 'http://127.0.0.1/backend/ride/firebase/send_fcm.php'; +// من داخل حاوية php لا يوجد خادم ويب على 127.0.0.1 — الويب في حاوية nginx +// منفصلة، وتُعرف داخل شبكة Compose باسم الخدمة. هذا كان سبب فشل كل إشعار. +$fcmUrl = getenv('FCM_INTERNAL_URL') ?: 'http://nginx/backend/ride/firebase/send_fcm.php'; $payload = json_encode([ 'target' => $topic, 'title' => $title, @@ -106,8 +108,9 @@ $curlErr = curl_error($ch); curl_close($ch); if ($response === false || $httpCode >= 400) { - error_log("[Broadcast] FCM call failed (HTTP $httpCode): " . ($curlErr ?: $response)); - jsonError("Notification service rejected the request (HTTP $httpCode).", 502); + $reason = $curlErr ?: (is_string($response) ? substr($response, 0, 200) : 'no response'); + error_log("[Broadcast] FCM call failed (HTTP $httpCode) via $fcmUrl: $reason"); + jsonError("Notification service unreachable at $fcmUrl — $reason", 502); } $decoded = json_decode((string) $response, true); diff --git a/dashboard/siro-admin/index.html b/dashboard/siro-admin/index.html index 281f3770..756f0e4c 100644 --- a/dashboard/siro-admin/index.html +++ b/dashboard/siro-admin/index.html @@ -15,7 +15,7 @@ - +
@@ -609,6 +609,6 @@ - +