import { getApp, getApps, initializeApp } from "firebase-admin/app";
import { getMessaging } from "firebase-admin/messaging";

const firebaseConfig = {
   apiKey: "AIzaSyB2hbsW91J3oRQx4_jgrCCNY0tNt5-21e8",
   authDomain: "googleapis.com",
   projectId: "mobile-darmasaba",
   storageBucket: "mobile-darmasaba.appspot.com",
   messagingSenderId: "867439221179",
   appId: "1:867439221179:android:4509f77478c8dce99b0c9e",
   databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/",
   measurementId: "G-1015652111565"
}

const app = getApps().length ? getApp() : initializeApp(firebaseConfig);

const messaging = async () => {
   return getMessaging(app)
}