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

[flutter_local_notifications] added ability to specify silent notification through AndroidNotificationDetails #2102

Merged
merged 6 commits into from
Nov 18, 2023

Conversation

aa-euclidk
Copy link
Contributor

@aa-euclidk aa-euclidk commented Sep 27, 2023

Thanks to TheFinestArtist for providing code for adding the silent option

Closes #2021

@aa-euclidk aa-euclidk changed the title [flutter_local_notifications] setSilent notification based on playSound argument [flutter_local_notifications] setSilent notification based on "silent" argument in AndroidNotificationDetails Oct 17, 2023
@@ -36,6 +36,7 @@ public class NotificationDetails implements Serializable {
private static final String ONGOING = "ongoing";
private static final String STYLE = "style";
private static final String ICON = "icon";
private static final String SILENT = "silent";
Copy link

@TheFinestArtist TheFinestArtist Oct 17, 2023

Choose a reason for hiding this comment

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

Nit: you might want to write this below ONGOING to keep the order with the rest.

  • Probably this is my fault.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

@@ -277,7 +277,8 @@ protected static Notification createNotification(
.setContentIntent(pendingIntent)
.setPriority(notificationDetails.priority)
.setOngoing(BooleanUtils.getValue(notificationDetails.ongoing))
.setOnlyAlertOnce(BooleanUtils.getValue(notificationDetails.onlyAlertOnce));
.setOnlyAlertOnce(BooleanUtils.getValue(notificationDetails.onlyAlertOnce))
.setSilent(BooleanUtils.getValue(notificationDetails.silent));
Copy link

@TheFinestArtist TheFinestArtist Oct 17, 2023

Choose a reason for hiding this comment

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

Nit: you might want to write this below ONGOING to keep the order with the rest.

  • Probably this is my fault.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

Choose a reason for hiding this comment

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

I am not super familiar, so I might not be right. But, I don't think this file change is related to the feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree but I'm not entirely sure. Feel free to remove it.

Choose a reason for hiding this comment

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

I am not super familiar, so I might not be right. But, I don't think this file change is related to the feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree but I'm not entirely sure. Feel free to remove it.

Choose a reason for hiding this comment

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

I am not super familiar with the example code and buttons.

Choose a reason for hiding this comment

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

Test looks good to me :D

@MaikuB MaikuB changed the title [flutter_local_notifications] setSilent notification based on "silent" argument in AndroidNotificationDetails [flutter_local_notifications] added ability to specify silent notification through AndroidNotificationDetails Nov 18, 2023
@MaikuB MaikuB merged commit 9d8c793 into MaikuB:master Nov 18, 2023
11 checks passed
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.

Support Android setSilent(boolean) functionality
3 participants