Twilio Client for Xamarin – Part 1: Introduction


Once upon a time, mobile application development required separate teams working on apps for iOS, Android and Windows Phone. There was very little code or skill sharing between these teams. You built an app for iOS in Objective-C then rebuilt the app for Android in Java and then potentially one more time for Windows Phone using C#. This siloed approach is very unproductive and expensive. Parts of the application that could easily be reused have to be rewritten to support another platform.

Xamarin burst on the scene in 2011 and completely changed the mobile development landscape. With Xamarin you are able to build fully native cross-platform mobile applications using the C# language. Xamarin makes 100% of the APIs on iOS and Android available to C# developers. It is a truly no compromise solution. If you can build it in Objective-C or Java you can build it with C#.

Xamarin Code Sharing

It is in this spirit of no compromises that I am extremely excited to bring Twilio Client for Mobile support to Xamarin developers in the form of a Twilio Client component for the Xamarin Component Store. By adding a few lines of code your iOS or Android application will be able to call any phone on the global telecom network as well as other instances of the same app directly using VoIP.

This post is the first in a series on using Twilio Client in Xamarin applications. In this post I will show you how to add the Twilio Client component to your application and point out a few resources to help you get started. Upcoming posts in the series will walk through building full-featured Twilio Client applications for iOS and Android.

For now let’s start with adding the component and taking a look at what resources are available in it.

Adding Twilio Client to your Xamarin app

Before you get started you will need to make sure you have a Xamarin Indie, Business, or Enterprise license. This is a requirement for using the Xamarin Component Store. If you don’t have a license yet you can start a 30-day Business trial.

The Component Store makes it really easy for you to add Twilio Client’s VoIP capabilities to your Xamarin applications. To add a component to your iOS or Android project, right-click on the Components node under the project and click Get More Components… to launch the Component Store.

Get More Components

Type “Twilio” in the search box in the upper-left to find the new Twilio Client for Xamarin component.   Once the component appears click on it in order to view the component details.

Search Component

Within the component details view click the Add to App button.  The component will be added to the project along with all of the necessary references needed to make it work:

Twilio Client Component

Once the installation completes it will display the contents of the component:

Component Details

The first thing displayed is the Getting Started page. This tutorial will walk you through building a sample application which turns your iPad or Android tablet into a phone. Additionally a sample project is included with the component for both iOS and Android that shows how to use all of the features included in the Twilio Client SDK. If you want to try out the sample you can find it on the Samples tab inside the component. The Assemblies tab lists the assembly that was added to the project (TwilioClient.iOS or TwilioClient.Android) by the component.

What next?

In this post I introduced the new Twilio Client component for Xamarin and showed how easy it is to add to your Xamarin application. In the next post I will show you how to setup the server side code that will be necessary to make our Twilio Client application app work. If you want to get a head start on this, all of the server code we will be building is detailed in the Getting Started guide that comes with the component. I’m excited to see what you build. Hit me up on Twitter @brentschooley if you run into any problems getting started.

  • Degs

    Finally! Looking forward to putting it to use.

    • Stoked to hear you’re excited Degs! Let us know what you create. Feel free to reach out if you need any help.

  • John Castlebur

    Hi there! Any clues on when the part 2 of this article will be published? Looking forward to it, since this one didn’t help much! ;) Thanks!

    • Working on Part 2 and Part 3 as we speak. In the meantime, check out the Getting Started tutorial in the component. Content will be similar.

  • Chui Tey

    Any prospects of having this on Windows Phone as well?

  • sdippl

    For everyone, who’s looking for Part 2 and 3. I stumbled upon them accidentally ;)


    … BTW is a Twilio 1.2 Xamarin component in the making?

    • Twilio Client component for 1.2 is live in the Component Store!

  • ufctime

    How can i send sms from twilio xamarin client?

  • Frederik W. Johansen

    Why does Twilio not support Windows Phone??? They have a nice client api for iOS and Android but not for Windows Phone. Please come on, we need one for Windows Phone also. Now with Windows 10 just around the corner, I would like to build Windows apps using a Twilio client api, and not some self-wrapped rest api, and i don’t want to use javascript!

    • Hi Frederik, thanks for reaching out. I am a Windows developer too so I totally understand where you’re coming from with your request. We appreciate the feedback and we are continuing to evaluate the platforms that we can bring Twilio Client to. As of right now we don’t have any announcements to make regarding plans for new platforms.

      • Frederik W. Johansen

        Hi Brent, thanks for your reply, but sorry to hear. I hope Twilio in the future will consider to support windows phone as well. I would like to see the Client in your Xamarin solution support all tree major platforms.

  • psopi

    I’m running android example but intent.GetParcelableExtra(Device.ExtraDevice) as Device returning null both for device and conn, any idea ?