Hi, tell me how you can send several messages at a time in firebase cloud messaging. Now I send them one by one:
$fields = array( 'registration_ids' => is_array($this->notification->getFcmToken()) ? $this->notification->getFcmToken() : array($this->notification->getFcmToken()), 'data' => array( "message" => $this->notification->getMessage(), "type_message" => $this->notification->getTypeNotification()) ); $this->notification->getMessage(); $headers = array( "Authorization:key = " . self::API_GCM_KEY, "Content-Type: application/json" ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, self::URL_GCM_SEND); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); $result = curl_exec($ch); if ($result === FALSE) { die('Curl failed: ' . curl_error($ch)); } curl_close($ch);