Microsoft.Bot.Builder.Location integrated with Cortana skills: issues selecting the address

260 Views Asked by At

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. emulator_out

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. enter image description here 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!

2

There are 2 best solutions below

0
On

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.

1
On

did this ever get resolved? I am currently integrating the BotBuilder.Location library as well, and all is well on the skype, facebook, etc... side, but concerning Cortana, after it prompts "what location are you interested in?" there is no method for input (microphone doesn't open up and text input is disabled).