NpawPluginTritonAdapter
Welcome to the NpawPluginTritonAdapter integration guide. This library facilitates seamless interaction with the Triton framework. Below you'll find comprehensive steps on how to integrate this library into your project using CocoaPods and Swift Package Manager, alongside setting up the accompanying demo.
Repository Sources:
Before integrating the library, ensure you've added the necessary repository sources to your CocoaPods:
source 'https://repo.plugin.npaw.com/release/plugin-ios-cocoapods.git'
source 'https://cdn.cocoapods.org'
Integration with CocoaPods:
1. Add the library to your Podfile:
Include the following pods:
# Pods for your project
pod 'NpawPluginPkg'
pod 'NpawPluginTritonAdapter'
2. Workaround for CocoaPods:
Due to a specific configuration with the NpawPluginTritonAdapter
, you will need to add a post-install script to your Podfile:
post_install do |installer|
target = installer.pods_project.targets.find { |t| t.name == "NpawPluginTritonAdapter" }
if target
framework_path = File.expand_path("Frameworks/TritonPlayerSDK.xcframework", __dir__)
file_ref = installer.pods_project.new_file(framework_path)
# Add to the main group (root) if you want
installer.pods_project.main_group.children << file_ref
# Create or find the Frameworks group and add the file reference to it
frameworks_group = installer.pods_project.groups.find { |g| g.name == 'Frameworks' } || installer.pods_project.new_group('Frameworks')
frameworks_group.children << file_ref
# Ensure the framework is linked in your target
target.frameworks_build_phase.add_file_reference(file_ref)
end
end
Make sure to place the TritonPlayerSDK.xcframework
in the recommended path. As a suggestion, create a folder named Frameworks
in the root directory of your project and place the .xcframework
there. The path should then look like this: Frameworks/TritonPlayerSDK.xcframework
.
Integration with Swift Package Manager:
File
> Swift Packages
> Add Package Dependency
.
1. Open your project in Xcode and navigate to 2. In the search bar, enter the following URL:
https://git.codavel.com/release/plugin-ios-triton-adapter
NpawPluginTritonAdapter
as a package dependency.
3. Follow the on-screen instructions to add
TritonPlayerSDK.xcframework
from the provided link and add it to your project:
4. Download - Drag and drop
TritonPlayerSDK.xcframework
into theFrameworks, Libraries, and Embedded Content
section underGeneral
settings of your target.
NpawTritonDemo (Example)
Within the project, an example demo named NpawTritonDemo
can be found at Examples/NpawTritonDemo
. This demo can be configured using either the Swift Package Manager (SPM) or CocoaPods.
Setting up with Swift Package Manager (SPM):
-
Open the Project:
open NpawTritonDemo.xcodeproj
-
Download the Triton XCFramework:
- Fetch the Triton XCFramework from Triton SDK Releases.
-
Add the Framework to the Project:
- Navigate to
NpawTritonDemo -> General -> Frameworks, Libraries, and Embedded Content
. - Drag and drop the downloaded
TritonPlayerSDK.xcframework
.
- Navigate to
-
Add the Package Dependency:
- Go to
NpawTritonDemo -> Project -> Package Dependencies
. - Click on the '+' and add the following URL:
https://git.codavel.com/release/plugin-ios-triton-adapter
- Go to
Setting up with CocoaPods:
-
Download the Triton XCFramework:
- Fetch the Triton XCFramework from Triton SDK Releases.
-
Setup the Framework Folder:
- Create a folder named
Frameworks
withinExamples/NpawTritonDemo
. - Copy the downloaded
TritonPlayerSDK.xcframework
into this folder. Ensure the pathExamples/NpawTritonDemo/Frameworks/TritonPlayerSDK.xcframework
exists.
- Create a folder named
-
Install the Pods:
pod install
-
Open the Workspace:
open NpawTritonDemo.xcworkspace
-
Link the Triton Framework:
- Navigate to
NpawTritonDemo -> General -> Frameworks, Libraries, and Embedded Content
. - Drag and drop
TritonPlayerSDK
from thePods/TritonPlayerSDK
directory.
- Navigate to