1

I am trying to get the current location of the user and I am using the Api.AI web tool to create my actions/intent.

Deployed using -

firebase --only functions

API.AI Action - enter image description here

Simulator - enter image description here

Full index.js - link

But when my action is triggered I get this message -

Sorry, this action is not available in simulation

Can't we ask for permission on a simulation ? Also how do I test my app on a real device ?

EDIT: The permission function is stuck in a loop -

enter image description here

Anurag-Sharma
  • 4,278
  • 5
  • 27
  • 42
  • Can you confirm what steps you're taking to go from API.AI to your fulfillment and how you've deployed to test and are invoking your Action? Do you have code that confirms that your requestPermission() function is called? – Prisoner Jul 12 '17 at 20:06
  • 1
    @Prisoner Edited the question. – Anurag-Sharma Jul 12 '17 at 20:21

1 Answers1

4

Your problem is in this block of code:

//Action business logic
function welcomeMessage(app){
    app.tell('Welcome !, Do you want to book a ride ?'); // Todo: Insert proper messages.
}

The app.tell() method sends the message and then closes the conversation. If you want to send the message to the user and keep the conversation going (ie - you're expecting a response) you need to use app.ask().

This is what is causing the "Sorry" message when you reply "Yeah" - your Action is no longer listening.

You can ask for permission in the simulation. Once you have run it once in the simulator, you should be able to access it on any device that is linked to the same account you used to develop the Action, or to other accounts you've permitted (once they have run the simulator).

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Thanks for pointing that out, Now my action is been triggered properly but it gets stuck in a loop. Check the question for the screen-shot. – Anurag-Sharma Jul 13 '17 at 17:15
  • Although this may seem like the same question to you - it is best asked as a new question in SO since the supporting information necessary will be different and it necessitates a different answer. – Prisoner Jul 13 '17 at 18:08
  • 1
    https://stackoverflow.com/questions/45089687/unable-to-accept-the-permission-prompt-on-actions-on-google – Anurag-Sharma Jul 13 '17 at 19:43