@ukpc-lib/react 0.2.18 → 0.2.20
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/assets/js/firebase-messaging-sw.js +5 -9
- package/dist/components/Notification/index.d.ts +1 -0
- package/dist/components/index.cjs +17 -17
- package/dist/components/index.js +1342 -1388
- package/dist/{index.module-1f98fe91.cjs → index.module-3865819a.cjs} +100 -100
- package/dist/{index.module-7166b9fa.js → index.module-c4038cae.js} +6709 -6663
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +11 -11
- package/package.json +1 -1
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.cjs +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-f95a0f73.js → index-c0b26f3f.js} +6031 -6037
- package/web-components-bundle/index-e993192a.cjs +884 -0
- package/web-components-bundle/index-c74328c1.cjs +0 -884
|
@@ -27,21 +27,17 @@ firebase.initializeApp(firebaseConfig);
|
|
|
27
27
|
const messaging = firebase.messaging();
|
|
28
28
|
|
|
29
29
|
//Handle incoming messages while the app is not in focus (i.e in the background, hidden behind other tabs, or completely closed).
|
|
30
|
+
const channel = new BroadcastChannel('my-channel');
|
|
30
31
|
messaging.onBackgroundMessage(function(payload) {
|
|
31
32
|
console.log('Received background message ', payload);
|
|
32
33
|
|
|
33
|
-
const notificationTitle = payload.data.
|
|
34
|
+
const notificationTitle = payload.data.userName;
|
|
34
35
|
const notificationOptions = {
|
|
35
|
-
body: payload.data.context
|
|
36
|
-
icon: 'https://ukpcsaprod.blob.core.windows.net/saas/notification-icon.svg'
|
|
36
|
+
body: `${payload.data.message} ${payload.data.context}`,
|
|
37
|
+
icon: 'https://ukpcsaprod.blob.core.windows.net/saas/notification-icon.svg',
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
self.registration.showNotification(notificationTitle,
|
|
40
41
|
notificationOptions);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// Use BroadcastChannel to send the message to the background script
|
|
44
|
-
// const channel = new BroadcastChannel('my-channel');
|
|
45
|
-
// channel.postMessage({ notificationTitle: payload.notification.title, notificationOptions: { body: payload.notification.body } });
|
|
42
|
+
channel.postMessage({notificationTitle, notificationOptions});
|
|
46
43
|
});
|
|
47
|
-
|