Dialogflow retrieving data from Firebase Real time database - firebase

Currently I'm working on a mobile app using Ionic and Angular2 with Realtime database service from firebase. I want to make a chatbot using Dialogflow to analyze the user request (i.e. I need a wheelchair) and then analyze the firebase db for any similar items stored, and if it exists, I need to show the item's name and the uid of the user who has added it into the database.
Have seen some tutorials on Dialogflow with Cloud Firestore but I'm not sure whether this works with the Realtime DB and how it would work.
Thanks in advance. 😊

To do this, you'll need to use a fulfillment webhook that will be sent the information about what the user has said, does the database search, and sends the reply using Dialogflow's response JSON format.

Related

I want connect my firebase information with my mail

I just created a contact form and I use firebase realtime database to get the information of the website visitor who want to contact me.
and now I want receive an email with the information form firebase each time a visitor send a contact submission from the web site.
how can I connect firebase realtime database with my email?
thank you
I hope this will help you achieve your desired functionality.
One way of doing is by using Firebase Cloud Functions. You state that you want to receive an email after a user persists information to firebase Realtime database. I suggest have a thorough look at Firebase Cloud Functions and look under firebase real-time database triggers. These functions get executed or are triggered after an operation(delete, update, write) occurs within the database. Also have a look at Firebase Functions Send Email for how to implement the email sending part.

Do any features of Firebase Cloud messaging require a Firebase database?

I'm thinking about implementing Firebase Cloud Messaging without implementing a firebase database and it's unclear to me which features of FCM are supported without having a firebase database.
For instance, getting message delivery statistics (https://firebase.google.com/docs/cloud-messaging/understand-delivery) and sending notifications via the firebase console (https://firebase.google.com/docs/cloud-messaging/js/send-with-console). It doesn't explicitly say whether you need a firebase database in either of documents but I'd like to clear about that before implementing it.
So my question is, do you need a firebase database to send notifications via the firebase console or to view message delivery statistics? I know for the latter you need to implement google analytics. And also as a bonus, are there any firebase features that depend on having a firebase database?
Thank you
All FCM features are supported without having to use Realtime Database. They are completely separate products, and are only related as much as you want them to be in your app.

Will my firebase cloud messaging API still work after my realtime database has been deactivated?

I received an e-mail from firebase-noreply #google.com to the tune of:
[Firebase] Your unused Realtime Database ‘my secret’ will be deactivated in 14 day(s)
We've detected the following issue(s) with your security rules:
any logged-in user can read your entire database
any logged-in user can write to your entire database
I have an app on my Raspberry Pi which is available by web, that will send a firebase message to my mobile phone. It will enable a user (any friend of mine that I chose to tell the url to) to track my position. The webpage on my Rpi contains the API key.
Following this e-mail, should I still expect my app to work?
It's a while since I wrote the app but I do find it occasionally useful. The link that firebase sent me to edit my security settings doesn't work. I think I only had an entry in the firebase realtime database to enable me to get an API key. Please forgive me if I am asking a daft question but it has been years since I worked on this.
firebaser here
The email is specific to the Firebase Realtime Database of your project, and won't affect Firebase Cloud Messaging in any way. If calls to FCM succeed before the database is disabled, they will continue to succeed after the database is disabled.
Of course, if your app needs to interact with the database to do its work, that will stop to function when the database is disabled.

Postman API to connect to Firebase Realtime DB

I am confused as to how to connect to my Firebase DB using, say Postman to send the REST requests.
In the screenshot below, you can see my DB structure and GET request.
Specifically, the GET request in Postman looks like this,
https://fir-crud-api-b1cec.firebaseio.com/products/test.json?auth=xxxx
while the DB is structured as such
products > test.json
Would appreciate any advice to point me in the right direction. Thanks!
Your URL suggests that you want to use the Realtime Datbase REST API, but your screenshot suggests that your data is in Firestore. These are different databases with different APIs.
If you want to work with data in Firestore, you should use the Firestore REST API instead.
The screenshot on the left shows the Cloud Firestore database, while in PostMan you are trying to access the Realtime Database. While both databases are part of Firebase, they're completely separate, and have completely separate REST APIs.
If you want to access Cloud Firestore from PostMan, have a look at its REST API. Fair warning that this API is significantly more complex than the one for the Realtime Database.
If you want to continue using the Realtime Database REST API, make sure to create your data structure in the Realtime Database in the Firebase console.

How can I access user data stored in Firebase using Google Assistant?

I have some user data stored in Firebase in users/userID/data
I'm using Dialogflow to recognize for example the following intent:
retrieve my email
which triggers a webhook and passes as parameter email, which is the data the user wants to retrieve. How to I pass the firebase userID? I guess I need to implement some kind of logging for the Google Assistant, but I cannot find how can I link the Firebase user account to google actions and how would I get this firebase userID
Is there a standard or recommend way to achieve this?
There is no pre-built solution for this right now.
You will need to implement Account Linking with the Google Assistant.It was done this way to give you, and your users, maximum flexibility. You'll be able to authenticate them using a variety of methods, not just Google Auth, and users are able to use a Google identity for you that may be different than the one they use for the Assistant. Account Linking will associate them without revealing to you which account they use on the Assistant.
This means creating an OAuth server that lets users log in using their Firebase account and issuing tokens to the Assistant. Google does provide some information about the procedure you should follow when creating your OAuth server, and you should be able to create this using Firebase Hosting and Firebase Cloud Functions.
Then, each time the Assistant calls your action, it will send the tokens back to you. You would use this token to determine the Firebase userid and then can look them up in the database.

Resources