Update: 2026-07-23 21:05:22
This commit is contained in:
@@ -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
|
||||
]
|
||||
]
|
||||
|
||||
@@ -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
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user