Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Push notifications with lower priority for Android devices #19061

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

ceefour
Copy link
Contributor

@ceefour ceefour commented Sep 29, 2020

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 #15803 (comment)

Proposed changes

According to node-gcm, it should be like this:

var message = new gcm.Message({
    collapseKey: 'demo',
    priority: 'high',
    ...

Compared to what gcm.js does as of v3.6.3:

const message = new gcm.Message({
		collapseKey: notification.from,
		//    delayWhileIdle: true,
		//    timeToLive: 4,
		//    restricted_package_name: 'dk.gi2.app'
		data,
	});

Issue(s)

Fixes #15803 (comment)

Improves upon #17357, #17907, and RocketChat/Rocket.Chat.ReactNative#2507.

How to test or reproduce

From @xtilyn:

Right now when phone enters doze mode, android app is not able to receive notifs.

You can test this by forcing doze mode using adb
adb shell dumpsys deviceidle force-idle

Then, if you send a message, the android client does not receive it until you disable doze mode with
adb shell dumpsys deviceidle unforce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

Checklist

Changelog

fix(push): Set push notification priority to 'high' for FCM

Further comments

cc @sampaiodiego

@sampaiodiego sampaiodiego changed the title [FIX] fix(push): Set push notification priority to 'high' for FCM [FIX] Push notifications with lower priority for Android devices Oct 20, 2020
@sampaiodiego sampaiodiego merged commit 7780aba into RocketChat:develop Oct 20, 2020
@sampaiodiego sampaiodiego mentioned this pull request Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants