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

Hide "Background Preparing" Notification in Foreground, Background, and Terminated States (Production Build) #492

Open
lm-neelgai opened this issue Nov 21, 2024 · 4 comments

Comments

@lm-neelgai
Copy link

I'm facing an issue with the "Background Preparing" notification in the production version of my app. I want to ensure that this notification does not appear in the status bar when the app is running in the foreground, background, or even when the app is terminated and restarted.

The current behavior is that the notification appears continuously in the status bar, which is unwanted in the production APK/bundle. This happens regardless of whether the app is in the foreground, background, or when the app is relaunched after being terminated.

Expected Behavior:
The "Background Preparing" notification should be hidden in all states (foreground, background, and after termination) in the production version of the app.
The notification should only appear in debug or development builds, if at all, but not in production.

Actual Behavior:
The "Background Preparing" notification remains visible in the status bar even when the app is running in the foreground, background, or after it has been terminated.

Version
^5.0.10

@Gerry1218
Copy link

me too

@sepehrsaberm
Copy link

same issue. any solution??

1 similar comment
@AdilHypeteq
Copy link

same issue. any solution??

@70p4z
Copy link

70p4z commented Jan 2, 2025

I found it that this line
https://github.com/ekasetiawans/flutter_background_service/blob/3b4baa28f47fb6e128b2328b7e36ed4c3e0e1335/packages/flutter_background_service_android/android/src/main/java/id/flutter/flutter_background_service/BackgroundService.java#L287C1-L287C43
is responsible for the "preparing" notification, and that, on my Oreo, it gets discarded when I use background mode instead of foreground (although the background has the side effect of crashing the app when the app is terminated from the task list, and restarted, but I couldn't figure this out just yet)

The underlaying question is: is there any functional need for that notification to even exist?

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

5 participants