Update: 2026-07-23 16:56:57

This commit is contained in:
Hamza-Ayed
2026-07-23 16:56:58 +03:00
parent 1cef598fc5
commit c35b350b31
9 changed files with 55 additions and 49 deletions
+9 -3
View File
@@ -11,9 +11,15 @@ class FcmService
public function __construct(?Redis $redis = null)
{
$this->redis = $redis;
// المسار بناء على بنية المشروع
$this->serviceAccountFile = getenv('FIREBASE_SERVICE_ACCOUNT_PATH');
$this->redis = $redis;
$envPath = getenv('FIREBASE_SERVICE_ACCOUNT_PATH') ?: '';
if (!empty($envPath) && file_exists($envPath)) {
$this->serviceAccountFile = $envPath;
} elseif (file_exists('/keys/firebase_service_account.json')) {
$this->serviceAccountFile = '/keys/firebase_service_account.json';
} else {
$this->serviceAccountFile = __DIR__ . '/../../keys/firebase_service_account.json';
}
}
// ── إرسال إشعار ────────────────────────────────────────