I am building Chat bot using Microsoft builder SDK for c#. Currently, I have working location dialog using Microsoft.Bot.Builder.Location with Facebook, emulator and Skype channels.
Recently, I have been trying to integrate bot with Cortana channel however Location Dialog does not seem to work as well as in other channels.
Once I select to “enter shipping” it prompts me for the address. I say the address and it updates the page with found possible locations (as carousel cards) and straight after it updates the page prompting me for selection of the correct address out of the possible found. However, I cannot select the correct option as it already updated the page and I can no longer view possible locations.
This is the way I have implemented location dialog:
var locationDialog = this.dialogFactory.Create<LocationDialog>(
new Dictionary<string, object>()
{
{ "prompt", string.Format(CultureInfo.CurrentCulture, Resources.RootDialog_Delivery_Address_Prompt, (await qtyResult).From.Name ?? "User") },
{ "channelId", context.Activity.ChannelId },
{ "apiKey", "apiKey"},
{ "options",LocationOptions.SkipFinalConfirmation | LocationOptions.SkipFavorites},
});
I am wondering Is there a different approach to get user location (shipping address) for Cortana channel? Thank you!
I had issues with this dialog as well. What I did was download the dialog and rework it completely to suit my needs (i also replaces bing with google as I could not get the search to work as it does on the bing maps site).
One of the issues is that the card and the message after it are two different messages. Cortana will update the canvas for each post, so I combined it into one.
I had a lot of issues with PromptDialog.Confirm not working so I replaced this with context.MakeMessage and attach the card as an attachment. Then post the message. In the message, you can have both the card and the text/speech. Then await the response.
The only problem is that you will have to interpret the response. I have yet to figure out how to do this automatically.