TF-2460 Fix real time updates for web are broken

This commit is contained in:
dab246
2024-03-22 17:03:15 +07:00
committed by Dat H. Pham
parent bdc140fcce
commit 971b228107
4 changed files with 53 additions and 1 deletions
+7 -1
View File
@@ -11,4 +11,10 @@ firebase.initializeApp({
appId: "...",
});
// Retrieve an instance of Firebase Messaging so that it can handle background messages.
const messaging = firebase.messaging();
const messaging = firebase.messaging();
const broadcast = new BroadcastChannel('background-message');
messaging.onBackgroundMessage((message) => {
broadcast.postMessage(message);
});