function notificationMessageClick()

in messaging/index.js [276:313]


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

  const message = {
    notification: {
      title: 'Breaking News....'
    },
    android: {
      notification: {
        clickAction: 'news_intent'
      }
    },
    apns: {
      payload: {
        aps: {
          'category': 'INVITE_CATEGORY'
        }
      }
    },
    webpush: {
      fcmOptions: {
        link: 'breakingnews.html'
      }
    },
    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_click]
}