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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: