This commit is contained in:
Hamza-Ayed
2026-04-29 01:00:29 +03:00
parent f2ee38ccee
commit 10d69033dd
5 changed files with 33 additions and 5 deletions

View File

@@ -57,10 +57,6 @@ class FcmService
$payload = [
'message' => [
'token' => $token,
'notification' => [
'title' => $title,
'body' => $body,
],
'data' => $processedData,
'android' => ['priority' => 'HIGH'],
'apns' => [
@@ -70,6 +66,13 @@ class FcmService
],
];
if (!empty($title) && !empty($body)) {
$payload['message']['notification'] = [
'title' => $title,
'body' => $body,
];
}
$ch = curl_init($fcmUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,