title: How to send FCM notification to a topic group from app using android studio
body: <p>I am trying to make push notifications using FCM in which any user subscribed to the topic &quot;Alerts&quot; can send a notification to others. I can recieve notifications sent using the FCM testing system. But when I was reffering to the documentation for sending push notifications, it gave me this code</p>
  <pre><code>String topic = &quot;highScores&quot;;
  
  // See documentation on defining a message payload.
  Message message = Message.builder()
      .putData(&quot;score&quot;, &quot;850&quot;)
      .putData(&quot;time&quot;, &quot;2:45&quot;)
      .setTopic(topic)
      .build();
  
  // Send a message to the devices subscribed to the provided topic.
  String response = FirebaseMessaging.getInstance().send(message);
  // Response is a message ID string.
  System.out.println(&quot;Successfully sent message: &quot; + response);
  </code></pre>
  <p>I had 2 problems in this
  First, the class named message does not exist. After much research, I found out the message class was deprecated and RemoteMessage had to be used but the RemoteMessage documentation had no proper instructions on how to do this.I need help in that<br />
  Second, a very small problem but does the topic name have to be the channel name or the topic to which everyone is subscribed to?
  Even sending the message to a list of tokens will be perfect</p>