diff --git a/desktop/src/push-notifications.js b/desktop/src/push-notifications.js --- a/desktop/src/push-notifications.js +++ b/desktop/src/push-notifications.js @@ -28,9 +28,6 @@ typeof userInfo.body !== 'string' || typeof userInfo.threadID !== 'string' ) { - console.error( - 'Notification must contain a string title, body and threadID', - ); return; } const { title, body, threadID } = userInfo; diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js --- a/keyserver/src/push/send.js +++ b/keyserver/src/push/send.js @@ -1039,6 +1039,27 @@ } } + const macosVersionsToTokens = byPlatform.get('macos'); + if (macosVersionsToTokens) { + for (const [codeVersion, deviceTokens] of macosVersionsToTokens) { + const notification = new apn.Notification(); + notification.topic = getAPNsNotificationTopic({ + platform: 'macos', + codeVersion, + }); + notification.badge = unreadCount; + notification.pushType = 'alert'; + deliveryPromises.push( + sendAPNsNotification('macos', notification, [...deviceTokens], { + source, + dbID, + userID, + codeVersion, + }), + ); + } + } + const deliveryResults = await Promise.all(deliveryPromises); await saveNotifResults(deliveryResults, new Map(), false); }