-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
The presentSound parameter also affects background behaviour #2097
Comments
Thanks for catching this. This a mistake in the documentation but potentially may need to consider how to fix this for the plugin. This is happening where a default sound is specified only if the code requests the sound to play via |
Actually on further thought, this is not as straightforward as some will want no sound to be played at all and developers are use to a null sound representing the default notification. I might have to consider a different approach. If you have an idea than feel free to share and/or submit a PR |
Just tried it and looks like passing any value to https://pub.dev/documentation/flutter_local_notifications/latest/flutter_local_notifications/DarwinNotificationDetails/sound.html whilst |
Thx for the quick fix @MaikuB I'll test in the next week (althought it looks like I'll need a custom sound anyway with the default sound being too low for the application we're making). |
Bug description
From the documentation
the
presentSound
parameter should only affect the foreground behaviour of the notification sound (like it does forpresentBanner
), but setting it tofalse
will also prevent the notification sound to be played when showing the notification while the app is in the background (tested on iOS).EDIT: interestingly enough, it does work with a custom sound, so that'll be my workaround
To Reproduce
presentSound
parameter tofalse
in the _zonedScheduleNotification method:Expected behavior
I'd expect a sound on notification.
Flutter doctor -v output
[✓] Flutter (Channel stable, 3.13.2, on macOS 13.5.1 22G90 darwin-x64, locale en-AT) • Flutter version 3.13.2 on channel stable at /Users/egon/Development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ff5b5b5fa6 (4 weeks ago), 2023-08-24 08:12:28 -0500 • Engine revision b20183e040 • Dart version 3.1.0 • DevTools version 2.25.0[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/egon/Library/Android/sdk
• Platform android-33, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.82.0)
• VS Code at /Users/egon/Development/Visual Studio Code.app/Contents
• Flutter extension version 3.72.0
[✓] Connected device (4 available)
• Egon’s (mobile) • 00008101-000A71A80A06001E • ios • iOS 16.6 20G75
• EFB (mobile) • CFFD813F-9D82-4D41-8D1B-68EC6DA2A3BD • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 13.5.1 22G90 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.187
[✓] Network resources
• All expected network resources are available.
The text was updated successfully, but these errors were encountered: