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

Change AudioAttributes to the notifications in android #1519

Closed
bornold opened this issue Mar 7, 2022 · 3 comments · Fixed by #1649
Closed

Change AudioAttributes to the notifications in android #1519

bornold opened this issue Mar 7, 2022 · 3 comments · Fixed by #1649

Comments

@bornold
Copy link
Contributor

bornold commented Mar 7, 2022

Hello @MaikuB 👋
First of all, thank you so much for the plugin! Huge fan!

Have a use case where we would like to change AudioAttributes for the notifications here:

Specifically to AudioAttributes.USAGE_ALARM

We are maintaining a fork so there is no problem for us just change the attribute, but I was wondering if there would be any interest in adding this to AndroidNotificationDetails?

If so, I would be happy to write a PR

@MaikuB
Copy link
Owner

MaikuB commented Mar 8, 2022

A PR would be welcome but would like know what the thought would be on how users of the plugin specify the attribute? If you're looking to expand this then I suspect it makes sense to allow any of the allowed attribute values to be specified then for backwards compatibility, assume the default value is AudioAttributes.USAGE_NOTIFICATION

@bornold
Copy link
Contributor Author

bornold commented Mar 14, 2022

Cool!
Yes, the user will specify the attribute in AndroidNotificationDetails
as a enum that defaults to AudioAttributes.USAGE_NOTIFICATION.

Even though it does not really make any sense to specify some of the attributes available in AudioAttributes.Builder.setUsage for a notification I believe it's best to include them all.

Guess I'll start working on a PR that in the coming weeks branching of 10.0.0?

@MaikuB
Copy link
Owner

MaikuB commented Mar 14, 2022

This sounds like something that wouldn't be a breaking change so if that's the case, it could use master as the target branch so that this goes out in a 9.x release

bornold added a commit to bornold/flutter_local_notifications that referenced this issue Jul 15, 2022
bornold added a commit to bornold/flutter_local_notifications that referenced this issue Aug 25, 2022
@MaikuB MaikuB closed this as completed in 801b6ca Aug 29, 2022
Kavantix pushed a commit to MedAppNL/flutter_local_notifications that referenced this issue Feb 8, 2023
…nDetails (MaikuB#1649)

* Add audioAttributesUsage to NotificationDetails

Allows users to change  AudioAttributes (https://developer.android.com/reference/android/media/AudioAttributes) to the notification sound

Closes: MaikuB#1519

* Adding null check when reading audioAttributesUsage in FlutterLocalNotificationsPlugin

* Adding missing enum 'notificationRingtone' in AudioAttributesUsage's property, 'values'
Kavantix pushed a commit to MedAppNL/flutter_local_notifications that referenced this issue Feb 8, 2023
…nDetails (MaikuB#1649)

* Add audioAttributesUsage to NotificationDetails

Allows users to change  AudioAttributes (https://developer.android.com/reference/android/media/AudioAttributes) to the notification sound

Closes: MaikuB#1519

* Adding null check when reading audioAttributesUsage in FlutterLocalNotificationsPlugin

* Adding missing enum 'notificationRingtone' in AudioAttributesUsage's property, 'values'
sheriffwoody0922 added a commit to sheriffwoody0922/flutter-cross-notifications that referenced this issue Feb 1, 2024
…nDetails (#1649)

* Add audioAttributesUsage to NotificationDetails

Allows users to change  AudioAttributes (https://developer.android.com/reference/android/media/AudioAttributes) to the notification sound

Closes: MaikuB/flutter_local_notifications#1519

* Adding null check when reading audioAttributesUsage in FlutterLocalNotificationsPlugin

* Adding missing enum 'notificationRingtone' in AudioAttributesUsage's property, 'values'
regisdev0827 added a commit to regisdev0827/flutter_local_notifications that referenced this issue Apr 27, 2024
…nDetails (#1649)

* Add audioAttributesUsage to NotificationDetails

Allows users to change  AudioAttributes (https://developer.android.com/reference/android/media/AudioAttributes) to the notification sound

Closes: MaikuB/flutter_local_notifications#1519

* Adding null check when reading audioAttributesUsage in FlutterLocalNotificationsPlugin

* Adding missing enum 'notificationRingtone' in AudioAttributesUsage's property, 'values'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants