nodebb-plugin-web-push 0.6.1 → 0.6.2
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/library.js +4 -2
- package/package.json +1 -1
package/library.js
CHANGED
|
@@ -99,7 +99,7 @@ plugin.addRoutes = async ({ router, middleware, helpers }) => {
|
|
|
99
99
|
nid: utils.generateUUID(),
|
|
100
100
|
bodyShort: 'Test notification',
|
|
101
101
|
bodyLong: 'This is a test message sent from NodeBB',
|
|
102
|
-
path:
|
|
102
|
+
path: `/me/web-push`,
|
|
103
103
|
}, req.uid, userLang);
|
|
104
104
|
await webPush.sendNotification(subscription, JSON.stringify(payload));
|
|
105
105
|
});
|
|
@@ -223,7 +223,9 @@ async function constructPayload(notification, uid, lang) {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
icon = icon || `${nconf.get('url')}/apple-touch-icon`;
|
|
226
|
-
badge
|
|
226
|
+
if (!badge) { // badge fallbacks
|
|
227
|
+
badge = `${nconf.get('url')}${meta.config['brand:maskableIcon'] || '/apple-touch-icon'}`;
|
|
228
|
+
}
|
|
227
229
|
|
|
228
230
|
return {
|
|
229
231
|
title,
|