logo
Firebase - Interview Questions and Answers
How would you send a push notification using Firebase Cloud Messaging (FCM)?
Use the Admin SDK in a Cloud Function :
const message = {
  notification: {
    title: 'New Post',
    body: 'Check out this update!'
  },
  token: 'user-device-token'
};
admin.messaging().send(message)
  .then((response) => console.log('Sent:', response))
  .catch((error) => console.error('Error:', error));?