How to obtain the user's location?
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!
Hi @serpino, I am looking at how this could be implemented.
You should open an issue on the webchat repo and close this one - https://github.com/Microsoft/BotFramework-WebChat
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,
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?