v0.12.40 iso notificastion bug fix

This commit is contained in:
2026-03-29 23:21:35 -04:00
parent d03baec163
commit ff6743c9b1
5 changed files with 46 additions and 10 deletions

View File

@@ -13,9 +13,13 @@ const FIREBASE_CONFIG = {
appId: "1:126479377334:web:280abdd135cf7e0c50d717"
};
// Initialise Firebase synchronously so the push listener is ready immediately
// Initialise Firebase synchronously so the push listener is ready immediately.
// Skip on iOS — iOS PWAs use standard W3C WebPush (VAPID), not FCM. Initialising
// firebase.messaging() on iOS registers a second internal push listener alongside
// the custom one below, causing every notification to appear twice.
const isIOS = /iPhone|iPad|iPod/.test(self.navigator?.userAgent || '');
let messaging = null;
if (FIREBASE_CONFIG.apiKey !== '__FIREBASE_API_KEY__') {
if (!isIOS && FIREBASE_CONFIG.apiKey !== '__FIREBASE_API_KEY__') {
firebase.initializeApp(FIREBASE_CONFIG);
messaging = firebase.messaging();
console.log('[SW] Firebase initialised');