Update: 2026-06-30 22:10:05

This commit is contained in:
Hamza-Ayed
2026-06-30 22:10:05 +03:00
parent 9a296742f1
commit 772f8b647d

View File

@@ -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);