Skip to content

Commit

Permalink
(docs) remove Firebase messaging code
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 26, 2024
1 parent 7a9a3dc commit 38b02c2
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions docs/src/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { initializeApp } from 'firebase/app';
import { getMessaging, getToken } from 'firebase/messaging';
import { getDatabase } from "firebase/database";

import EventEmitter from '@site/src/EventEmitter';

Expand All @@ -13,20 +13,6 @@ const firebase_config = {
appId: '1:1005897028349:web:fc2d0f5524864d5d17e494'
};

const vapid_key = 'BCwx3BcH1YFCjBfWy3qmEZyVukPf-cLZUfVe9j3j1bwRcYi1aVhiEHPZqBvAcnvSyfznGoRHQrv3I2fDyBfULxk';

export const firebase = initializeApp(firebase_config);

const messaging = getMessaging(firebase);

export async function register() {
const emitter = new EventEmitter();
const sw = await navigator.serviceWorker.register('/firebase-messaging-sw.js');
const listen = async () => {
const token = await getToken(messaging, { vapidKey: vapid_key, serviceWorkerRegistration: sw });
emitter.emit('token', token);
};
listen();
return emitter;
}

const database = getDatabase(firebase);

0 comments on commit 38b02c2

Please sign in to comment.