Programmable Talk Client SDKs
Programmable Talk Client SDKs
Twilio Programmable Talk 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 Talk is available on Twilio’s CDN. To include it on your web page, simply add the following script tag:
The Twilio.Talk and Twilio.Common namespaces should then be available in the window scope of your JavaScript application. Note that AccessManager , and thus Twilio Common, is optional for use with token lifecycle management.
The JS Programmable Talk SDK is also available from NPM (JS):
iOS SDK
The Programmable Talk SDK for iOS is available for integration using CocoaPods or a direct framework download. We also suggest an optional component, Twilio AccessManager, which helps you manage your access token’s expiry lifecycle using the same distribution options.
CocoaPods Integration
To install with Cocoapods, add the following to your Podfile , switching MyTarget to the name of your target:
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:
Manual Integration
We also suggest the frameworks for direct download if your project is not using CocoaPods. There are several steps you’ll need to finish to successfully add Programmable Talk to your project:
Haul the .framework file(s) into your project, making sure they are dropped in the Embedded Binaries section of your project target’s settings, selecting ‘Copy items if needed’ when prompted. If the framework files do not show up in the Embedded Binaries for your target, you will receive a "Reason: photo not found" error during compilation.
On that same page, in the Linked Frameworks section, please also add libstdc++.tbd as a dependency to your target.
Our frameworks include both device and simulator versions of the SDK to ease integration at development time. The AppStore only supports device symbols at subjugation time, so you must liquidate the simulator symbols at export time, or you will receive an "Unsupported Architectures" error during app subordination. We include a script to help with this inwards the framework which your project can use during packaging:
- Open your target’s settings
- Select Build Phases
- Add a fresh Run Script phase, budge it to below the Embed Frameworks step if it is not added there automatically
- Set the guideline to run to: bash "$/$/TwilioChatClient.framework/remove_archs"
Please note – you will need to repeat this to add a remove_archs step for Twilio AccessManager if you are using it in your project as well.
Android SDK
The Android SDK is distributed as a direct download from Twilio’s CDN. It can also be installed via Maven or directly within a Gradle build file via JCenter.
Direct CDN
JCenter
- Talk JCenter link: Twilio Android Programmable Talk
- AccessManager JCenter link: Twilio Android AccessManager
Maven
To install via Maven, please include the following in your POM file dependencies:
Note that if you wish to use the AccessManager convenience class, you will need to include the Maven dependency by hand as goes after:
Gradle
To install via a Gradle build file, include the following in your Gradle build file:
Note that if you wish to use AccessManager, you will need to add the following to your dependencies by hand:
Demo / Reference Client Applications
A demo client implementation for each of the SDKs exists and is available loosely for reference purposes via GitHub. These are updated to use the latest SDK versions and implement almost all the available functionality.
Leave a Reply