Follow this step-by-step tutorial to implement the Watch Together video chat sample application.
While the client-side application will take care of most of the functionality, in order to make this sample application work, you will need to get an access token from the Cluster Authentication Server (CAS).
To better understand the Watch Together architecture have a look at this guide - Watch Together overview
An Access Token is needed in order to allow a client to connect to a Session.
Note: It is important that the client application does not request an Access Token directly from the backend. By doing that you risk exposing the API_TOKEN and API_SECRET.
You can get your API_KEY and API_SECRET in your private area, here.
Note: Every Streaming Token corresponds to one specific Session only. To allow two different clients to connect to the same Session, the clients need to use the same Access Token.
Going to production
To go to production you will need to implement your own authentication server. Using the server the Access Token will be shared to your various clients (Web, Android, and iOS). With this valid Access Token you will be able to use the service.
For that you will need:
API_KEY, and API_SECRET - can be retrieved in your private area once you login
Configure your product organization, bundle, and team names
Set the application location on your computer and press "create"
Adding Watch Together iOS SDK library to the project
In case you require to use an Objective-c project, please add the WatchTogetherAdapter to your project
Download the library (Private area) package and unpack it
Create a folder with the name "WatchTogether" in the root of the project
Copy all files ("WatchTogether.framework","WatchTogether.podspec") to created folder
[When using the Objective-c adapater] - do the following extra steps
Create a folder named "WatchTogetherAdapter" in the root of the project
Copy all the files unpacked from the SDK ("WatchTogetherAdapter.framework","WatchTogetherAdapter.podspec") to "WatchTogetherAdapter" folder
Open folder with your project in Terminal
Print the command "pod init"
Print the command "open Podfile"
In the opened file paste this string pod 'WatchTogether', :path => './WatchTogether'
after "target 'Your project name' do" and save file
[When using the Objective-c adapater] - do the following extra steps
In the opened file paste the following strings
pod 'WatchTogetherAdapter', :path => './WatchTogetherAdapter'
pod 'WatchTogether', :path => './WatchTogether'
extensionParticipantView:ParticipantDelegate{funconReconnecting() {print("Participant reconnecting") }funconReconnected() {print("Participant reconnected") }funconChangeMediaSettings() {print("Participant has changed media settings") }funconStreamUpdate(qualityInfo: StreamQualityInfo) {print("Participant has new quality info \(qualityInfo.quality)") }}