Track location on background react native expo

I want to store the user location in firebase real-time database when there is a change in the user location.
I want it will work when the app running on foreground and background using react native expo

I tried to create a task running on background but didn’t succeed