Programmable Chat Client SDKs

Twilio Programmable Chat provides client-side SDKs for browser-based web applications as well as for native iOS and Android applications.

JavaScript SDK

The latest version of the JavaScript SDK for Chat is available on Twilio's CDN. To include it on your web page, simply add the following script tag:

<script src="https://media.twiliocdn.com/sdk/js/common/v0.1/twilio-common.min.js"></script>
<script src="https://media.twiliocdn.com/sdk/js/chat/v0.11/twilio-chat.min.js"></script>

The Twilio.Chat and Twilio.Common namespaces should then be available in the window scope of your JavaScript application. Note that AccessManager and thus Common is optional, for use with token lifecycle management.

iOS SDK

The Chat SDK for iOS is distributed as two Frameworks, one of which is optional, you include in your Xcode project.

When installing manually, you will also need to include libstdc++.tbd in your Linked Frameworks and Libraries in Xcode:

linked libraries

To install with Cocoapods, add the following to your Podfile, changing MyTarget to the name of your target:

source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/twilio/cocoapod-specs'

target 'MyTarget' do
  pod 'TwilioChatClient'
end

If you wish to use the optional AccessManager framework (for token lifecycle management, you will need to add the following pod target to your MyTarget block:

  pod 'TwilioAccessManager', '~> 0.1.2'

Android SDK

The Android SDK is distributed as a direct download, below, or can be installed via Maven, or directly within a Gradle build file - via JCenter.

JCenter link: Twilio Android Programmable Chat

To install via Maven, please include the following in your POM file dependencies:

<dependency>
  <groupId>com.twilio</groupId>
  <artifactId>chat-android</artifactId>
  <version>0.11.0</version>
  <type>pom</type>
</dependency>

Note that if you wish to use the AccessManager convenience class, you will need to manually include the Maven dependency as follows:

com.twilio accessmanager-android 0.1.0 pom

To install via a Gradle build file, include the following in your Gradle build file:

allprojects {
    repositories {
        jcenter()
    }
}

/**
 * Declare dependencies
 * @see http://www.gradle.org/docs/current/userguide/userguide_single.html#sec:how_to_declare_your_dependencies
 */
dependencies {
    compile 'com.twilio:chat-android:0.11.0'
}

Note that if you wish to use AccessManager you will need to add the following to your dependencies manually:

compile 'com.twilio:accessmanager-android:0.1.0'

Demo / Reference Client Applications

A demo client implementation for each of the SDKs exists, and is available freely for reference purposes via GitHub. These are updated to use the latest SDK versions, and implement almost all the available functionality.

JavaScript

https://github.com/twilio/twilio-chat-demo-js

iOS

https://github.com/twilio/twilio-chat-demo-ios

Android

https://github.com/twilio/twilio-chat-demo-android