Fix APNs push type for visible notifications on iOS

This commit is contained in:
Hamza-Ayed
2026-06-30 22:09:27 +03:00
parent 116e3fad22
commit 9a296742f1

View File

@@ -60,8 +60,8 @@ class FcmService
'data' => $processedData,
'android' => ['priority' => 'HIGH'],
'apns' => [
'headers' => ['apns-priority' => '10', 'apns-push-type' => 'background'],
'payload' => ['aps' => ['content-available' => 1]],
'headers' => ['apns-priority' => '10'],
'payload' => ['aps' => []],
],
],
];
@@ -71,6 +71,11 @@ 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);