1

I am using Dialogflow to create an action for the Google assistant. I am following this tutorial: https://medium.com/voice-tech-podcast/get-current-location-of-a-user-using-helper-intents-in-actions-on-google-19fe9a8ea99f

When I use the command firebase deploy in step 5, this is the output that I get:

=== Deploying to 'location-tracker-xxxx'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> lint
> eslint .

✔  functions: Finished running predeploy script.
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔  functions: required API cloudbuild.googleapis.com is enabled
✔  functions: required API cloudfunctions.googleapis.com is enabled
i  functions: preparing functions directory for uploading...

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/location-tracker-xxxx/overview

I am supposed to get Webhook URL which I can use as webhook URL in Dialogflow.

This is my index.js:

const functions = require("firebase-functions");
const { dialogflow, Permission, SimpleResponse } = require("actions-on-google");

const app = dialogflow();

app.intent("Default Welcome Intent", conv => {
    conv.data.requestedPermission = "DEVICE_PRECISE_LOCATION";
    conv.ask(new SimpleResponse('Welcome to location tracker'));
    return conv.ask(
      new Permission({
        context: "to locate you",
        permissions: conv.data.requestedPermission
      })
    );
  });

I have read this Stackoverflow but it did not solve my problem because there is not shown what the solution was science the code referred to is not available anymore.

Thanks!

Emilie van Eps
  • 121
  • 1
  • 9

1 Answers1

0

As Doug alluded to in the comments, you need to ensure that you have a function exported in your code. This can be added to the bottom:

exports.ActionsOnGoogleFulfillment = functions.https.onRequest(app);

The ActionsOnGoogleFulfillment is the name of your function. It will be deployed when you run that command.

You can view all functions in the Firebase console, and you should expect it to be in the format:

https://us-central1-**PROJECT_ID**.cloudfunctions.net/**FUNCTION_NAME**

Nick Felker
  • 11,536
  • 1
  • 21
  • 35