From e7aa28fe3d7f6faddfd4b5c5c36e3a9b948f5142 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 23 Jul 2026 21:05:22 +0300 Subject: [PATCH] Update: 2026-07-23 21:05:22 --- backend/ride/firebase/fcm_fun.php | 5 ++++- backend/ride/firebase/send_fcm.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/ride/firebase/fcm_fun.php b/backend/ride/firebase/fcm_fun.php index ba1332b1..588456df 100644 --- a/backend/ride/firebase/fcm_fun.php +++ b/backend/ride/firebase/fcm_fun.php @@ -23,6 +23,9 @@ function resolveFCMServiceAccountPath($serviceAccountPath = null) { if (file_exists('/keys/firebase_service_account.json')) { return '/keys/firebase_service_account.json'; } + if (file_exists(__DIR__ . '/../../keys/firebase_service_account.json')) { + return __DIR__ . '/../../keys/firebase_service_account.json'; + } return __DIR__ . '/service-account.json'; } @@ -130,7 +133,7 @@ function sendFCMNotification($params) { 'headers' => ['apns-priority' => '10'], 'payload' => [ 'aps' => [ - 'sound' => $tone . '.caf', + 'sound' => ($tone === 'ding' || $tone === 'default') ? 'default' : (str_ends_with($tone, '.caf') ? $tone : $tone . '.caf'), 'content-available' => 1 ] ] diff --git a/backend/ride/firebase/send_fcm.php b/backend/ride/firebase/send_fcm.php index 5a730472..39cdd336 100644 --- a/backend/ride/firebase/send_fcm.php +++ b/backend/ride/firebase/send_fcm.php @@ -19,6 +19,9 @@ function resolveServiceAccountPath(): string { if (file_exists('/keys/firebase_service_account.json')) { return '/keys/firebase_service_account.json'; } + if (file_exists(__DIR__ . '/../../keys/firebase_service_account.json')) { + return __DIR__ . '/../../keys/firebase_service_account.json'; + } return __DIR__ . '/service-account.json'; } @@ -125,7 +128,7 @@ $messagePayload = [ 'headers' => ['apns-priority' => '10'], 'payload' => [ 'aps' => [ - 'sound' => $tone . '.caf', + 'sound' => ($tone === 'ding' || $tone === 'default') ? 'default' : (str_ends_with($tone, '.caf') ? $tone : $tone . '.caf'), 'content-available' => 1 ] ]