web-manager 4.0.16 → 4.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -0
- package/dist/modules/notifications.js +0 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -311,6 +311,11 @@ class Manager {
|
|
|
311
311
|
const { getFirestore } = await import('firebase/firestore');
|
|
312
312
|
const { getMessaging } = await import('firebase/messaging');
|
|
313
313
|
|
|
314
|
+
// If we're in devmode, set the firebase config authDomain to the current host
|
|
315
|
+
// if (this.isDevelopment() && firebaseConfig) {
|
|
316
|
+
// firebaseConfig.authDomain = window.location.hostname;
|
|
317
|
+
// }
|
|
318
|
+
|
|
314
319
|
// Initialize Firebase
|
|
315
320
|
const app = initializeApp(firebaseConfig);
|
|
316
321
|
|
|
@@ -157,31 +157,6 @@ class Notifications {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
// Listen for token refresh
|
|
161
|
-
async onTokenRefresh(callback) {
|
|
162
|
-
try {
|
|
163
|
-
if (!this.isSupported()) {
|
|
164
|
-
return () => {};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const { onMessage } = await import('firebase/messaging');
|
|
168
|
-
const messaging = this.manager.firebaseMessaging;
|
|
169
|
-
|
|
170
|
-
if (!messaging) {
|
|
171
|
-
return () => {};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return onMessage(messaging, (payload) => {
|
|
175
|
-
if (payload.data?.refreshToken) {
|
|
176
|
-
callback(payload.data.token);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
} catch (error) {
|
|
180
|
-
console.error('Token refresh listener error:', error);
|
|
181
|
-
return () => {};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
160
|
// Listen for foreground messages
|
|
186
161
|
async onMessage(callback) {
|
|
187
162
|
try {
|
package/package.json
CHANGED