web-manager 3.2.71 → 3.2.72
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/index.js +7 -3
- 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 (!
|
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(
|
1221
|
+
window.open(clickAction, '_blank');
|
1218
1222
|
}
|
1219
1223
|
})
|
1220
1224
|
} catch (e) {
|
package/package.json
CHANGED