3D printer control application

Hello!
I want to create a 3D printer control application, but I have a question.
Even if the application is turned off while exchanging values in the Firebase real-time database, I would like to retrieve the print output completion value of the print and notify my smartphone of the print output completion.

I would appreciate it if you could let me know if there is a way to communicate with the firebase through background work.