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

[Bug]: ForegroundNotificationConfig.setOngoing has no effect, notification can be dismissed #1559

Open
3 of 8 tasks
orkun1675 opened this issue Aug 18, 2024 · 4 comments
Open
3 of 8 tasks

Comments

@orkun1675
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • 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
[Paste your code here]

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

12.0.0

Flutter Doctor output

Doctor output
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!```

</details>
@TimHoogstrate
Copy link
Contributor

Dear @orkun1675,

On what Android version are you testing this? Does this also happen on the supplied example app?

Kind regards,

@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Aug 19, 2024
@orkun1675
Copy link
Author

Hi Tim!

I am testing on a Pixel 8 Pro emulator that is running Android 35.

I was able to replicate the issue using the example app: source

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Aug 22, 2024
@orkun1675
Copy link
Author

Hmm, it looks like Android no longer supports ongoing notifications after v34: https://developer.android.com/about/versions/14/behavior-changes-all#non-dismissable-notifications

What a bummer. Unfortunately neither the NotificationCompat.Builder or the Foreground services documentation mentions this.

I wonder if dimissing the notification kills the foreground service?

@Stimm4
Copy link

Stimm4 commented Aug 26, 2024

Hi,
I saw that deleting the notification did not kill the service.

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

No branches or pull requests

3 participants