web-manager 3.2.69 → 3.2.70

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.
Files changed (2) hide show
  1. package/index.js +7 -2
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.69",
3
+ "version": "3.2.70",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {