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

[Android] Remove default alert for silent push notifications #707

Conversation

superandrew213
Copy link
Contributor

On Android silent push notifications trigger alert with Notification received message when app is in background.

If there is no message supplied then user should not be alerted with a default message. Otherwise it makes silent push notifications impossible on Android.

At the moment every time a silent push notification is received (while app is in background) user receives an alert with Notification received message.

Fixes: #410

@@ -29,7 +29,7 @@ public void onMessageReceived(String from, final Bundle bundle) {
JSONObject data = getPushData(bundle.getString("data"));
if (data != null) {
if (!bundle.containsKey("message")) {
bundle.putString("message", data.optString("alert", "Notification received"));
bundle.putString("message", data.optString("alert", null));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zo0r is there a reason why alert is used as the field and not message?

@superandrew213
Copy link
Contributor Author

@zo0r & @npomfret can you have a quick look at this. It's a minor change that can be quickly merged. It shouldn't break anything, unless there is a reason why it was done like this.

@superandrew213 superandrew213 changed the title [Android] Remove alert for silent push notifications [Android] Remove default alert for silent push notifications May 20, 2018
@Gp2mv3 Gp2mv3 merged commit 2281819 into zo0r:master Jul 4, 2018
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.

None yet

2 participants