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