I'm looking for a way to launch a python process that update my firebase Realtime Database when I click on a given button of my react native App.
I also want that my screen shows a loading animation until the end of the python process.
To do this, I have the following function that update the field "is_calculateMatch" to True.
getMatchs = () => {
Firebase.database().ref('users/usersStrategy/is_calculateMatch').set(true);
//Loading animation : TODO
}
In the python side, I use a listener that catch the changes, run the task and update "is_calculateMatch" to False
def listener(event):
#... Run python code
db.reference(firebase_db_path_insert + "/is_calculateMatch").set(False)
firebase_admin.db.reference("users/usersStrategy").listen(listener)
My question is how to add the "Loading animation" part and more generally, how to add a listener on the react native side?
Thanks for your help