Programmable Chat Client SDKs
The Twilio Conversations API is now Generally Available! We recommend using Conversations to build your chat application to get access to additional channels and even more functionality.
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/chat/v4.0/twilio-chat.min.js"></script>
これにより、Twilio.Chat
名前空間が、JavaScript アプリケーションのウィンドウスコープで使用できるようになります。
JS Programmable Chat SDKはNPM (JS)からもご利用いただけます。
iOS SDK
The Programmable Chat SDK for iOS is available for integration using CocoaPods or a direct framework download.
We ship dSYM files which can assist in crash reporting for versions of Programmable Chat for iOS 2.3.2 and above. You can read more about integrating these dSYM's in the documentation. If you use Google Firebase Crashlytics in your application, you are encouraged to perform these additional steps when integrating Programmable Chat.
CocoaPodsインテグレーション
Cocoapodを使ってインストールするには、下記を Podfile
に追加し、MyTarget
をターゲット名に変更してください。
source 'https://github.com/CocoaPods/Specs' target 'MyTarget' do pod 'TwilioChatClient', '~> 4.0' end
Carthage Integration
We support integration using Carthage binary frameworks. You can add Programmable Chat for iOS by adding the following line to your Cartfile
:
github "twilio/twilio-chat-ios"
Then run carthage bootstrap
(or carthage update
if you are updating your SDKs.)
The .framework file(s) will be downloaded to the Carthage/Build/iOS
directory. The final step is to complete integration below.
直接統合
また、CocoaPodsを使用していない場合は、フレームワークの直接ダウンロードもご利用いただけます。 プロジェクトにProgrammable Chatを正常に追加するには、いくつかの手順を完了することが必要です。
Upon expanding the .tar.gz file, you will find the .framework file(s) inside the directory created. The final step is to complete integration below.
Completing Framework Integration
These steps are done for you if you are using CocoaPods, but are required if using either Carthage or Direct integration.
.frameworkファイルをプロジェクトにドラッグし、プロジェクトのターゲット設定のEmbedded Binaries
セクションにドロップされていることを確認し、"Copy items if needed"プロンプトが表示されたらそれを選択します。 frameworkファイルがターゲットのEmbedded Binaries
に表示されない場合、コンパイル時に "Reason: image not found" エラーが表示されます。
On that same page, in the Linked Frameworks
section, please also add libc++.tbd
as a dependency to your target if it is not already there.
Our frameworks include both device and simulator versions of the SDK to ease integration at development time. The AppStore only supports device symbols at submission time, so you must remove the simulator symbols at export time, or you will receive an "Unsupported Architectures" error during app submission. We include a script to help with this inside the framework which your project can use during packaging:
- ターゲットの設定を開く
- 選択
Build Phases
- 新規
Run Script
フェイズを追加し、それをEmbed Frameworks
ステップの下に(自動的に移動しない場合は)移動します。 - 実行するコマンドを設定します:
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/TwilioChatClient.framework/remove_archs"
フェーズメモ: Twilio AccessManagerをプロジェクトで使用している場合、これに対してremove_archs
を追加する手順を繰り返すことが必要です。
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
- Chat JCenter link: Twilio Android Programmable Chat
Gradle
Gradle ビルド・ファイル経由でインストールするには、下記をお使いのGradle ビルド・ファイルにインクルードしてください:
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:6.2.0' }
デモ / リファレンス・クライアント・アプリケーション
Core Chat SDKs
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
Other SDKs/Tools
The additional 3rd party bindings and reference implementations below one of the core SDKs.
React Native
https://github.com/twilio/TwilioChatJsReactNative
Cordova
https://github.com/twilio/twilio-chat-js-cordova-example
Requires the following plugins:
https://github.com/twilio/cordova-plugin-twilio-common
https://github.com/twilio/cordova-plugin-twilio-chat
Web Console Client
With FCM pushes functional
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。