Skip to content

Commit

Permalink
Fix android notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste-dulac committed May 2, 2019
1 parent 3c45dd5 commit 86ee2ea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Sender/AndroidSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ private function sendBatch(array $devices, MessageInterface $message)
$data = [
'data' => [
"title" => $message->title(),
"message" => trim(nl2br($message->message())),
"notId" => $message->id()
"body" => trim(nl2br($message->message())),
],
'registration_ids' => $devices,
];

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send');
curl_setopt($ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
Expand All @@ -52,4 +51,4 @@ public function send(MessageInterface $message): void
$this->sendBatch($device, $message);
}
}
}
}

0 comments on commit 86ee2ea

Please sign in to comment.