1

What I am trying to do here is, suppose a hospital which provides certain facility has several centres(locations) in the country. Now when the user requests for such hospital, the bot should be able to output him the location of the nearby hospital. I do have the list of all such hospitals in Firebase Real-Time Database with respective longitude and latitude.

My appraoch is to get the user's location and compare it with the available locations in the database for a nearby location?

On this link, It is discussed how to get the location of the user using "Google Actions". I want to do the same thing (getting the precise location of the user) using dialogflow-fulfullment (WebhookClient({ request, response });) from Inline editor on Dialogflow so that I can use Real-Time Database of Firebase.

My motive is to make it inclusive to most of other platforms as well. Whereas, Google Actions are only valid for Google Assistant.

PS: Any suggestion on this would be highly appreciable. I would be happy to put more clarification if required.

Shivam
  • 192
  • 1
  • 12

2 Answers2

1

Getting the user's permission for location is only a feature of Actions on Google and not Dialogflow itself. You could ask the user to provide their current location manually, but would face difficulty doing it automatically otherwise.

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

Spoke with Dialogflow Support Team

enter image description here

Mentioned link in the email: https://developers.google.com/actions/reference/rest/Shared.Types/Permission

You can use Actions on Google Helpers to retrieve the user location. You can follow this link for documentation: https://developers.google.com/actions/assistant/helpers#user_information

Shivam
  • 192
  • 1
  • 12