18
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user