web-manager 3.2.71 → 3.2.72

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1198,15 +1198,19 @@ function subscriptionManager(self, options_user) {
1198
1198
  firebase.messaging().onMessage(function (payload) {
1199
1199
  // Get the notification data
1200
1200
  var notification = payload.notification;
1201
+ var data = payload.data;
1202
+
1203
+ // Get the click action
1204
+ var clickAction = notification.click_action || data.click_action;
1201
1205
 
1202
1206
  // Log
1203
- console.log('Message received', payload);
1207
+ console.log('Message received', payload, clickAction);
1204
1208
 
1205
1209
  // Display notification
1206
1210
  new Notification(notification.title, notification)
1207
1211
  .onclick = function(event) {
1208
1212
  // Quit if there is no click action
1209
- if (!notification.click_action) {
1213
+ if (!clickAction) {
1210
1214
  return;
1211
1215
  }
1212
1216
 
@@ -1214,7 +1218,7 @@ function subscriptionManager(self, options_user) {
1214
1218
  event.preventDefault();
1215
1219
 
1216
1220
  // Open the click action
1217
- window.open(notification.click_action, '_blank');
1221
+ window.open(clickAction, '_blank');
1218
1222
  }
1219
1223
  })
1220
1224
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.71",
3
+ "version": "3.2.72",
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": {