const admin = require("../config/firebase");

async function sendPushNotification({ token, title, body, data = {} }) {
  if (!token) return;

  await admin.messaging().send({
    token,
    notification: {
      title,
      body,
    },
    data,
  });
}

module.exports = { sendPushNotification };
