Reputation: 1727
I have a python script on my laptop in which I want to push some data continuously to firebase realtime database.Now this was easy but I had to create a web app firebase project for that. Next I want to retrieve the same data from this web-app firebase database from my flutter app but I think for that I need to create an android firebase project.
So how to send data from my python script to android firebase project?
For python I created a web app project and this was the config I received from firebase:
firebaseConfig = {
"apiKey": "...",
"authDomain": "...",
"projectId": "...",
"storageBucket": "...",
"messagingSenderId": "...",
"appId": "...",
"measurementId": "..."
}
firebase = pyrebase.initialize_app(firebaseConfig)
db = firebase.database()
data = {"key":"value"}
db.push(data)
So this was easy but on my flutter app I cannot connect to the same database nor android firebase project provides the same config to connect with python.
So what other options I have or any solution to this problem?
Thanks in advance.
Upvotes: 0
Views: 634
Reputation: 573
For your Python Script that runs on you laptop you should use the "Python Firebase Admin SDK". It will write to your normal Firebase Database. I have a Python Script running and uploading things to my Fireabse DB and my Android App can read it.
Upvotes: 1