Implement SDK to your project
Choose whether to implement SDK through Cocoapods, SwiftPackageManager or manual download. Here are step by step explanations.
Integration
When setting up a new project, make sure that in your targets Build Settings you add "App Transport Security Settings" and add "Allow Arbitrary Loads" and set boolean to YES. This SDK depends on GoogleAds-IMA-tvOS-SDK.
APPROACH | NOTES |
---|---|
Swift Package Manager | - No SDK download is required. - Apple official way of implementing third party dependecies. - An existing app is required.GET STARTED with the Swift Package Manager approach |
CocoaPods | - No SDK download is required. - Core and optional modules must be added to your app. - An existing app is required.GET STARTED with the CocoaPods approach |
Demo | - TargetVideo SDK for tvOS must be downloaded. - An existing app is required.GET STARTED with the Local approach |
Swift Package Manager
To add a package dependency to your Xcode project, select File > Add Package Dependency and enter the GitHub repository URL: "https://github.com/PredragJ/TargetVideoSDKtvOS". Select Branch Dependecy rule and enter "main" as a branch name.
Select the target to which you want to add the package and click Finish.
CocoaPods
Add SDK to an Xcode project
- Install CocoaPods and create a Podfile using CocoaPods
- At the Terminal prompt, enter
$ gem install cocoapods
to install CocoaPods. - Enter
$ cd <path-to-your-project>/<your-project>/
to navigate to your project directory. - Enter
$ pod init
to create a file named Podfile. Podfile defines the dependencies for your project. - Edit the Podfile
- In a text editor, open your Podfile.
- Add TargetVideoSDKtvOS as a dependency. To add a specific version of the SDK, be sure to use the proper Podfile syntax.
- Save your Podfile and close the text editor.
# Uncomment the next line to define a global platform for your project
platform :tvos, '16.0'
target 'TargetVideoProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for TargetVideoProject
pod 'TargetVideoSDKtvOS'
end
Install the SDK
- At the terminal prompt of your project directory, enter $ pod install to install the TargetVideoSDK for tvOS.
- Open the .xcworkspace file for your project to launch Xcode.
- When set User Script Sandboxing in your targets Build Settings to No and build your project.
- You have retrieved your TargetVideo player license key and imported the TargetVideoSDK for tvOS into your project. You can now configure your project.
Demo
The TargetVideo SDK for tvOS Open Source Demo is a basic demonstration app. In this Demo App you can test all player events and methods.
Link to TargetVideo Demo App.
Updated about 2 months ago