Firebase in Background Task Extension

I’ve been searching this for hour. Is there any way I can get a value from firebase real-time database while my app is closed or running in the background?
I saw this post Firebase Notification(even after app gets killed)
but there’s not enough information and the aia file seems to not work for me.

Basically, I want to have an app that can fetch data to firebase even though my app is closed and notify me if value had changed.

Try using

As I’ve said in the post, I’ve tried Background Task already using this Firebase Notification(even after app gets killed) as reference, but there’s not enough explanation and the aia is not working. How can I implement background task to firebase?