Xamarin Forms Tip: Implementing a ChatBot in your Xamarin App

If you have used the Microsoft Bot Framework and would like to implement it in your app.. here is a quick an easy way:


In your content page of choice, simply implement a WebView. Once you create your WebView, you want to create an HtmlWebViewSource, where you can write actual HTML right on the C# page. With in your HTML simply insert an iframe. Your iframe source link can be found on the Bot Framework site, after you publish your bot (it will include your app id and app secret so you wont have to go find it). It is also important to know that your app secret is not generated in Azure (when you create your other app keys). You need to generate it by clicking the edit button in the web chat row on your bot profile:


It is also good to know that you can adjust the size of your embedded chatbot in the html iframe tag by adding: style=’height:380px; width:302px;’.

Hope this helps πŸ™‚


** Btw please excuse my horrible code formatting in the above screenshot. But if I did not move the html code over, the screenshot would not fit all of the example. I promise I fixed it in real life**


Published by Gabrielle

The Unexpected Nerd | Software Engineer | Gamer | Sneaker Enthusiast | Alpha WomanπŸ’—πŸ’š

One thought on “Xamarin Forms Tip: Implementing a ChatBot in your Xamarin App

  1. Hello! I’ve been reading your blog for some time now
    and finally got the bravery to go ahead and give you a shout out from Porter Tx!
    Just wanted to tell you keep up the excellent work!
    Maglie Calcio Bambini

Leave a Reply

%d bloggers like this: