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] The notification closes when closing the application #28

Closed
miguelflores1993 opened this issue May 27, 2021 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@miguelflores1993
Copy link

Describe the bug

I bought an s10 plus phone.
I just tested flutter_background and when I close the app the notification closes as well.
I have seen in some applications that when the application is completely closed, a notification always remains on the screen.

To Reproduce
close the application the notification closes

Expected behavior
The notification should not be closed.

Screenshots
none

Smartphone:
Samsumg s10 +
android 11

@miguelflores1993 miguelflores1993 added the bug Something isn't working label May 27, 2021
@JulianAssmann
Copy link
Owner

This is expected behaviour, see #10
Is there a specific reason you want the notification to live on after the app is closed?

@miguelflores1993
Copy link
Author

Este es el comportamiento esperado, consulte el n . ° 10.
¿Hay alguna razón específica por la que desea que la notificación siga activa después de que se cierre la aplicación?

@JulianAssmann
Yes, because I am applying the Offline First Mobile architecture, and I need that when the application is closed it still sends the local SQLITE data to the Amazon cloud.

Similar to WhatsApp when it is synchronizing your data and when you close it, a current notification appears.

@JulianAssmann
Copy link
Owner

I'm not sure this plugin is the best choice for this kind of task.
This plugin keeps the Flutter app running in the background, but the Flutter runtime is terminated when the user explicitly closes the app (e.g. by swiping up in the task view). So there is no use in still holding on to the Wake Lock, as nothing would happen anyway. I don't know the specifics of your use case, but maybe something like the Android JobScheduler or the workmanager plugin might be more suitable to it. However, background execution on Android is a mess in general (see here and dontkillmyapp for more).

@miguelflores1993
Copy link
Author

No estoy seguro de que este complemento sea la mejor opción para este tipo de tarea.
Este complemento mantiene la aplicación Flutter ejecutándose en segundo plano, pero el tiempo de ejecución de Flutter finaliza cuando el usuario cierra explícitamente la aplicación (por ejemplo, deslizando hacia arriba en la vista de tareas). Por lo tanto, no tiene sentido seguir aferrándose al Wake Lock, ya que de todos modos no pasaría nada. No conozco los detalles de su caso de uso, pero tal vez algo como Android JobScheduler o el complemento workmanager podría ser más adecuado para él. Sin embargo, la ejecución en segundo plano en Android es un desastre en general (consulte aquí y dontkillmyapp para obtener más información).
@JulianAssmann
How will facebook or whatssap be able to do it? will they have their own sdk?

thanks for your clarification

@JulianAssmann
Copy link
Owner

You're welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants