I cannot find any way that i can run code while my application is minimized. When i am on desktop if i use the Application.runInBackground = true;
then it works in background but on the application it does not. What i need to do it to have the code running so i can have communication to a MQTT server, send and receive data. Upon the app minimizes any script does not work. The only thing that i found it works is that if i put a notification to show up at a later time, even if i minimize the app it comes but because the command run while the app was open, after i minimize the app, it stops sending notifications.