Help to run in background

How can I run firebase database in background will it run even when app is closed ?

Please help me

Background function have some bugs for now bro

When it will be updated