web-manager 3.2.69 → 3.2.70
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +7 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1147,7 +1147,10 @@ function subscriptionManager(self, options_user) {
|
|
1147
1147
|
}))
|
1148
1148
|
)
|
1149
1149
|
.then(function (registration) {
|
1150
|
+
// Force Firebase to use the service worker
|
1150
1151
|
// firebase.messaging().useServiceWorker(registration);
|
1152
|
+
|
1153
|
+
// Set the registration to the properties
|
1151
1154
|
self.properties.references.serviceWorker = registration;
|
1152
1155
|
|
1153
1156
|
// TODO: https://googlechrome.github.io/samples/service-worker/post-message/
|
@@ -1187,8 +1190,11 @@ function subscriptionManager(self, options_user) {
|
|
1187
1190
|
//@@@NOTIFICATIONS
|
1188
1191
|
// _setupTokenRefreshHandler(self);
|
1189
1192
|
|
1193
|
+
// Force update the service worker
|
1194
|
+
registration.update();
|
1195
|
+
|
1196
|
+
// Normally, notifications are not displayed when user is ON PAGE but we will display it here anyway
|
1190
1197
|
try {
|
1191
|
-
// Normally, notifications are not displayed when user is ON PAGE but we will display it here anyway
|
1192
1198
|
firebase.messaging().onMessage(function (payload) {
|
1193
1199
|
new Notification(payload.notification.title, payload.notification)
|
1194
1200
|
.onclick = function(event) {
|
@@ -1199,7 +1205,6 @@ function subscriptionManager(self, options_user) {
|
|
1199
1205
|
} catch (e) {
|
1200
1206
|
console.error(e);
|
1201
1207
|
}
|
1202
|
-
|
1203
1208
|
})
|
1204
1209
|
.catch(function (e) {
|
1205
1210
|
// console.log('***2');
|
package/package.json
CHANGED