Baseflow / Baseflow/flutter-geolocator
[Bug]: ForegroundNotificationConfig.setOngoing has no effect, notification can be dismissed
- Dominant language
- Dart
- Stars
- 1.3k
- Forks
- 803
- Avg merge
- 8h 16m
- Merged PRs (30d)
- 1
Description
### Please check the following before submitting a new issue.
- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-geolocator/issues).
- [X] I have carefully [read the documentation](https://github.com/Baseflow/flutter-geolocator/blob/main/geolocator/README.md) and verified I have added the required platform specific configuration.
### Please select affected platform(s)
- [X] Android
- [ ] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [ ] Windows
### Steps to reproduce
1. Set `AndroidSettings.ForegroundNotificationConfig.setOngoing = true`
2. Start a foreground service using `getPositionStream()`
3. The service notification will appear as expected
4. Try swiping left/right on the notification
### Expected results
The notification can't be dismissed.
### Actual results
The notification is dismissed / dissapears.
### Code sample
Code sample
```dart
[Paste your code here]
```
### Screenshots or video
Screenshots or video demonstration
[Upload media here]
### Version
12.0.0
### Flutter Doctor output
Doctor output
```console
flutter doctor -v
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.6.1 23G93 darwin-arm64, locale en-US)
• Flutter version 3.24.0 on channel stable at /Users/orkun/git/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 80c2e84975 (3 weeks ago), 2024-07-30 23:06:49 +0700
• Engine revision b8800d88be
• Dart version 3.5.0
• DevTools version 2.37.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /Users/orkun/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1)
• 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
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.92.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.94.0
[✓] Connected device (4 available)
----
[✓] Network resources
• All expected network resources are available.
• No issues found!```
Contributor guide
Research direction
Start by reproducing the Android behavior with AndroidSettings.ForegroundNotificationConfig.setOngoing = true and getPositionStream(). Trace the foreground notification configuration from that entry point and verify on Android that the notification remains present when swiped; add or update coverage if the repository provides a relevant test location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100