Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find the function url for Firebase webhook in Google Assistant tutorial

I've been doing the Codelabs tutorial on "Facts about You: Build a conversational app for the Google Assistant" but have run into a problem.

Page 4 of the tutorial is devoted to using Cloud Functions for Firebase for setting up a webhook to provide custom responses. Step 7 on that page says "Once the Cloud Functions is deployed, the Function URL will be printed in the Firebase CLI logs. This URL is separate from the Project Console URL.”

My problem is that I only see the Console URL. I don’t see a Function URL anywhere.

Can anyone please clarify where I should find the Function URL? My app won’t run properly without knowing the endpoint URL for the webhoook.

Thanks!

like image 860
Mark Avatar asked Sep 06 '17 20:09

Mark


4 Answers

When the codelab instructs you to run firebase deploy --only functions, it will output the URL for the HTTP function that you created. It will be the last line of output and look something like this:

Function URL (foo): https://us-central1-my-codelab.cloudfunctions.net/foo

Copy that URL - it's your webhook endpoint.

like image 71
Doug Stevenson Avatar answered Sep 28 '22 06:09

Doug Stevenson


I noticed you included the tag #actions-on-google in your question. I think perhaps Firebase does not print the URL for dialogflowFirebaseFulfillment actions. But, you can also view your functions' URLs inside the Firebase console.

If you don't know it already, you can get the console's URL from deploying. After deploying the console URL will be printed in the output as shown below. Note console URL does not change from deploy to deploy, so you can bookmark it as well.

Project Console: https://console.firebase.google.com/project/goodmorningroutine-ac4b1/overview

Inside the Firebase console go to Functions on the left. That page will show a list of functions each with its request URL as shown below.

enter image description here

like image 30
studgeek Avatar answered Sep 28 '22 07:09

studgeek


I was facing the same issue ..... I Just saved the file before deploying

That easy I hope it works for you

like image 41
The Infinite Will Avatar answered Sep 28 '22 08:09

The Infinite Will


I ran into the same problem.

It works when I deploy the file from here.

After comparing with my own file, I realized that missed two lines in failed case:

const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
like image 38
陳得妮 Avatar answered Sep 28 '22 06:09

陳得妮