iOS - Swift/Objective-c
Overview
Follow this step-by-step tutorial to implement the video playback Synchronization SDK.
While the client-side SDK will take care of most of the functionality, in order to make this sample application work, you will need to use the API_KEY provided to you.
Full code samples can be found here
Requirements
To complete this guide successfully the following prerequisites are required:
A Sceenic account
Access key for Synch SDK
iOS version 11 or higher
Authentication
An Access Token
is needed in order to allow a client to connect to a sync group.
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.
Acquiring an Access Token
The Access Token
is a JWT token - more about jwt you can read - here.
A successful response will look like that:
You can get your API_KEY and API_SECRET in your private area, here.
Note: Every Sync Token corresponds to one specific sync group only. To allow two different clients to connect to the same group, the clients need to use the same Access Token
.
Create a project
Open Xcode and create a new project
Choose a Single View application
Configure your product organization, bundle, and team names
Set the application location on your computer and press “create”
Adding iOS SynchSDK library to the project
You can drag SynchSDK.framework to the project tree and use this library manually.
Cocoapods
Download library (Private area) package and unpack it
Create a folder with the name "SynchSDK" at the root of the project
Copy all files ("SynchSDK.framework","SynchSDK.podspec") to the folder
You can use Cocoapods to install SynchSDK by adding it to your Podfile
pod 'SynchSDK', :path => './SynchSDK'
[When using the Objective-c adapater] - do the following extra steps
Create a folder with the name "SynchSDK" at the root of the project
Copy all files ("SynchSDKAdapter.framework","SynchSDKAdapter.podspec") to the folder
You can use Cocoapods to install SynchSDK by adding it to your Podfile
pod 'SynchSDKAdapter', :path => './SynchSDKAdapter'
Instantiating the SDK
Initialize SynchSDK object:
Start synchronization - To start using the SynchSDK object you will require a SynchSdk’s URL and a valid Access Token to be available before connecting.
Stop synchronization
Managing synchronization logic
To manage the synchronization logic we provided several callbacks and will allow you to customize the interactions you need.
The SynchListener interface, which the StreamView implements in the sample application, will allow you to control the flow of logic of the Synchronization you are managing
Support
Need technical support? contact us at Support@sceenic.co.
Last updated