function notificationMessage()

in messaging/index.js [205:232]


function notificationMessage() {
  // [START fcm_notification_message]
  const topicName = 'industry-tech';

  const message = {
    notification: {
      title: '`$FooCorp` up 1.43% on the day',
      body: 'FooCorp gained 11.80 points to close at 835.67, up 1.43% on the day.'
    },
    android: {
      notification: {
        icon: 'stock_ticker_update',
        color: '#7e55c3'
      }
    },
    topic: topicName,
  };

  getMessaging().send(message)
    .then((response) => {
      // Response is a message ID string.
      console.log('Successfully sent message:', response);
    })
    .catch((error) => {
      console.log('Error sending message:', error);
    });
  // [END fcm_notification_message]
}