From d4c46b4516e65aa0a59f75d0910c8c650d904956 Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Wed, 30 Sep 2020 02:25:16 +0700 Subject: [PATCH] fix(push): Set push notification priority to 'high' for FCM According to https://www.npmjs.com/package/node-gcm#usage and recommendation in https://developer.android.com/training/monitoring-device-state/doze-standby Continuation of https://github.com/RocketChat/Rocket.Chat/pull/15803#issuecomment-657771803 --- app/push/server/gcm.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/push/server/gcm.js b/app/push/server/gcm.js index 05acee5b8819..a677e630b196 100644 --- a/app/push/server/gcm.js +++ b/app/push/server/gcm.js @@ -74,6 +74,9 @@ export const sendGCM = function({ userTokens, notification, _replaceToken, _remo const message = new gcm.Message({ collapseKey: notification.from, + // Requires delivery of real-time messages to users while device is in Doze or app is in App Standby. + // https://developer.android.com/training/monitoring-device-state/doze-standby#exemption-cases + priority: 'high', // delayWhileIdle: true, // timeToLive: 4, // restricted_package_name: 'dk.gi2.app'