how to send a notification for a theme from my server to firebase

I am sending a message from my server to firebase for a specific topic, I get back an id, but it does not get a notification to the app when I do it from the console to that topic the notification arrives.

How should I do it for a specific topic but that is a notification?


    function send_notification ($message)
        $url = '';
        $fields = array(

             'to' => "/topics/news",
             'data' => $message
        $headers = array(
            'Authorization: key=AAAApDF81wE:APA91bG7g.....',
            'Content-Type: application/json'
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL, $url);
       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));
       return $result;

    $message = array("message" => " FCM PUSH NOTIFICATION TEST MESSAGE");
    $message_status = send_notification($message);
    echo $message_status;

I just changed this

$fields = array(

         'to' => "/topics/news",
         'notification' => $message

i Was not doing proper handling in the app, i should handle the logic and code implementation on how to handle incoming messages within the onMessageReceived method.