botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

How to obtain the user's location?

Open serpino opened this issue 8 years ago • 4 comments

Bot Info

  • SDK Platform: .NET Core
  • SDK Version: Core
  • Active Channels: WebChat
  • Deployment Environment: Azure Bot Service, Azure App Service, Bot Emulator

Issue Description

I need to get information about the user's location, (longitude, latitude, browser data, etc.) either through an API call or by receiving a new message or conversationUpdate.

How can I do it?

Thanks!

serpino avatar May 21 '18 11:05 serpino

Hi @serpino, I am looking at how this could be implemented.

stevkan avatar May 21 '18 21:05 stevkan

You should open an issue on the webchat repo and close this one - https://github.com/Microsoft/BotFramework-WebChat

amitbend avatar May 22 '18 12:05 amitbend

Hi @serpino,

You will first need to collect the location, browser, etc., data via the webpage that is hosting your bot. You can then use webchat's backchannel option to pass the data to the bot that can then make use of the data. I was able to build this and test successfully. I used ipstack.com as the location data provider, but any should work. In my test, the page gathered the information on load. Then, using a button, I could send the data to the bot which then displayed the received data. You can look over my example located here.

Hope this helps.

stevkan avatar May 24 '18 16:05 stevkan

Hi @serpino,

You will first need to collect the location, browser, etc., data via the webpage that is hosting your bot. You can then use webchat's backchannel option to pass the data to the bot that can then make use of the data. I was able to build this and test successfully. I used ipstack.com as the location data provider, but any should work. In my test, the page gathered the information on load. Then, using a button, I could send the data to the bot which then displayed the received data. You can look over my example located here.

Hope this helps.

Hi @serpino This repo is not Available, I'm also having the same requirement to get the location through browser. Can you help me out?

cmnisal avatar May 14 '20 05:05 cmnisal