v0.12.40 iso notificastion bug fix
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user