From 772f8b647d47120fb7793dc2f818bdaea691e229 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Tue, 30 Jun 2026 22:10:05 +0300 Subject: [PATCH] Update: 2026-06-30 22:10:05 --- backend/core/Services/FcmService.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/core/Services/FcmService.php b/backend/core/Services/FcmService.php index 3ef3ab89..c178a807 100644 --- a/backend/core/Services/FcmService.php +++ b/backend/core/Services/FcmService.php @@ -13,7 +13,7 @@ class FcmService { $this->redis = $redis; // المسار بناء على بنية المشروع - $this->serviceAccountFile = getenv('SERVICE_ACCOUNT_FILE_PATH') ?: getenv('FIREBASE_SERVICE_ACCOUNT_PATH'); + $this->serviceAccountFile = getenv('FIREBASE_SERVICE_ACCOUNT_PATH'); } // ── إرسال إشعار ──────────────────────────────────────── @@ -60,8 +60,8 @@ class FcmService 'data' => $processedData, 'android' => ['priority' => 'HIGH'], 'apns' => [ - 'headers' => ['apns-priority' => '10'], - 'payload' => ['aps' => []], + 'headers' => ['apns-priority' => '10', 'apns-push-type' => 'background'], + 'payload' => ['aps' => ['content-available' => 1]], ], ], ]; @@ -71,11 +71,6 @@ class FcmService 'title' => $title, 'body' => $body, ]; - $payload['message']['apns']['headers']['apns-push-type'] = 'alert'; - $payload['message']['apns']['payload']['aps']['sound'] = $tone === 'ding' ? 'default' : $tone; - } else { - $payload['message']['apns']['headers']['apns-push-type'] = 'background'; - $payload['message']['apns']['payload']['aps']['content-available'] = 1; } $ch = curl_init($fcmUrl);