Fulfillment URL is not valid in Dialogflow | Using Cloud Functions - firebase

I was using Dialogflow API V1 until now and everything was working fine. It seems like the Dialogflow API V2 is now the default. I am not sure if this is the reason but I am not able to deploy cloud functions anymore.
In the fulfillment tab, it is not letting me enabled the cloud function toggle. Every time I try to enable and click deploy it gives me the following error:
Fulfillment URL is not valid
It's weird because I am not using fulfillment URL and still I am getting this error.

One workaround that worked for me when. I wanted to create a back up bot for my existing LIVE bot to use it for testing. I was getting the same issue once I restored my zip and after that try to edit the stock fulfillment.
What worked for me was, I edited the fulfillment first .index.js and package.json both after which I restored the bot using zip folder that added intents and entities to the agent. after which I was able to deploy cloud functions without getting the error.

Related

Unable to call Firebase function from React.js application

I have a React.js application powered by a number of Firebase functions and real time database standing behind them. It has been working without any issue for the past 2-3 months and now I am getting a warning on the functions logs which says that:
#firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Failed to parse access token response: Error: Server responded with status 404.\"."}
The way I initialize firebase from my React.js application looks like this:
I have double-checked everything standing behind process.env and it seems to be as expected. The website written in React.js in hosted under the Firebase hosting.
And this is how Firebase functions connect to Admin SDK:
I am not sure what would be the issue here. Nothing has changes in the code base from our side. Not sure if Firebase changed something internally that we need to consider.
What solved the issue for me was to go to the google cloud console (where Firebase functions are also available). Then I opened one of the failing cloud functions and I navigated to
My_Function_Name/Edit/RUNTIME, BUILD AND CONNECTIONS SETTINGS/RUNTIME SERVICE ACCOUNT/
And then I noticed there that for all of my functions it was selected App Engine Default Service Account instead of Firebase Admin SDK. I never explicitly set the runtime to this option. So, when I brought it back to Firebase Admin SDK the error was gone I was able to use the application once again.

Google API requested! - Displayed in firebase serve

I have trouble authenticating my Google API and have no clue how to solve it. I want to get my Firestore document by using the REST api but it gives me no data at all in postman.
http://localhost:5000/<project-id>/us-central1/api/todos
I have tried this in my project dir and using cmd.
set GOOGLE_APPLICATION_CREDENTIALS="/functions/util/apikey.json"
But still no changes.
Below is my terminal that shows the warning.

HTTP endpoints was either down or not responding

I made an action for Google Assistant using dialogue flow. When submitting the Action for production it's Getting denied.
The Webhook is on Firebase Function, the logs are empty. I re-submitted version 2 with changing the endpoint. Everything work when I test in the Simulator or my phone.
Do the Firebase function work only in particular region and not globally? If so there is no option to select the region
UPDATE
I did the deployment of Alpha as Nick suggested in the comments, It's failing in my all alpha testers too. Did I do something wrong in the configuration of the webhook or in the dialog flow code?
Here is my index.js
https://github.com/Aarth-Tandel/CountryName

Google cloud functions do not work with ifttt

I created an ifttt Applet using youtube video like as a trigger with a webhook(https cloud function) as an action. I get an error on iffttt that there was a problem with the webhooks service. I tested it with https://requestb.in url and ifttt works with it. is there something i'm missing to do too get a webhook working with cloud functions? I have already enabled billing for the function project.
I should have checked functions logs to begin with. I assumed it never ran. There was a error in my code, I was using JSON.parse() that was leading to error. Now it is functional.

implement push notification in firebase with batch

I am trying to make firebase and batch work together so that I can fire push notification when something in firebase db got changed. I followed this tutorial and now i want to make them work automatically and for that i contacted with batch's and they replied me
write your own server-side code to 1. detect Firebase db changes 2. call the Batch API.
For "detect Firebase db changes" I have to create a server-side code which will track changes and call batch's api accordingly. Then follow this documentation for attaching the changed content and send it to appropriate user.
I don't know how to create the server side code. Anyone can give me a quick instructions on it or there's any tutorial related to this?
To write server-side Firebase code you can use the node.js SDK. See https://www.firebase.com/docs/web/quickstart.html (search the page for node.js).
The API is exactly the same as the regular web API except that you'll be writing it as a node.js application that can be run on the server. You can then integrate this with Batch's API.

Resources