How can i avoid the restart of my application at unwanted times ? Flutter

Viewed 55

I am using a package named flutter_background_service which allows me to have a service running h24 to search information on the Web. The problem is that normally there is a loop with an interval that can change to fetch information.

I noticed by going to see the different services in the developer tools (Oneplus Nord 2) that my service (my application in general) restarts by itself when my phone turned on sleep mode or at certain events. This is not the case for many applications like Instagram, WhatsApp, etc...

So my question is, how can I prevent the app from restarting so often to let my loop do itself?
Is there a package that allows me to change this or something to change in the different Android files ?

Thanks in advance for your help

0 Answers
Related