aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vnext/server/middleware/event.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/vnext/server/middleware/event.js b/vnext/server/middleware/event.js
index 8280f32b..c80f2249 100644
--- a/vnext/server/middleware/event.js
+++ b/vnext/server/middleware/event.js
@@ -26,8 +26,9 @@ function processMessageEvent(msg) {
subscribers(new URLSearchParams(JSON.parse(JSON.stringify(params)))).then(users => {
return users.map(user => {
log(`${user.uname}: ${user.unreadCount}`)
+ let tokenTypes = msg.service ? ['mpns', 'apns', 'fcm'] : ['mpns', 'apns', 'fcm', 'web']
let [sandboxTokens, productionTokens] = (user.tokens || [])
- .filter(t => ['mpns', 'apns', 'fcm', 'web'].includes(t.type))
+ .filter(t => tokenTypes.includes(t.type))
.map(t => t.type === 'web' ? JSON.parse(t.token) : t.token)
.reduce((result, element) => {
allSandboxIds.includes(user.uid)