Add the SDK (iOS)

Download the SDK and add the SDK to your iOS app


To add JWP's video experience to your app, you must import the JWP iOS SDK (app) and then configure your project.

You can download the SDK using one of the following approaches:

πŸ’‘

If you have any problems completing any of these tasks and have a valid JWP license, please log a support ticket for assistance.



CocoaPods

Install CocoaPods and create a Podfile

  1. At the Terminal prompt, enter gem install cocoapods to install CocoaPods.
  2. Enter cd <path-to-your-project>/<your-project>/ to navigate to your project directory.
  3. Enter pod init to create a file named Podfile. Podfile defines the dependencies for your project.

Edit the Podfile

  1. In a text editor, open Podfile.
  2. Set the iOS version to 12.0 or greater.
  3. If you are using Objective-C, you can comment out use_frameworks!.
  4. Add JWPlayerKit as a dependency. To add a specific version of the SDK, be sure to use the proper Podfile syntax.
  5. Save Podfile and close the text editor.
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'

target 'MyAwesomeProject' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyAwesomeProject
  pod 'JWPlayerKit', '>= 4.0.0'
end

Install the SDK

  1. At the Terminal prompt of your project directory, enter pod install to install the SDK.
  2. Open the .xcworkspace file for your project to launch Xcode.

You can now configure your project.



Local

Download the SDK

iOS SDK downloads

iOS SDK downloads

Follow these steps to download the SDK:

  1. On the Properties tab, click the name of a property. The property settings page appears.
  2. Under Network & setup files, click Player setup files. The Player setup files page appears.
  3. Under iOS SDK, click Downloads. The iOS SDK downloads panel opens.
  4. In the row of the SDK version to download, click to download the .zip version to your computer.
  5. On your computer, unzip the SDK .zip file.
  6. In the JWP dashboard, click Close. The panel closes.

Import the SDK into your project

Follow these steps to import the SDK:

  1. From within Xcode, select your project from the project navigator.
  2. Select the target in the left column of the project editor.
  3. Click General.
  4. In the Linked Frameworks and Libraries, click +.
  5. Click Add Other.
  6. Select JWPlayerKit.xcframework (iOS) from your computer.
  7. Click Open.

You can now configure your project.



Swift Package Manager

The Swift Package Manager (SwiftPM) is a tool for managing the distribution of Swift code. You can add a package dependency to your project via the Xcode UI, or by directly adding it to the package.swift file.


Xcode UI

  1. Open your project in Xcode.
  2. Select the File > Add Package Dependency item from the menu bar.

    πŸ’‘

    As an alternative, follow these steps:

    1. Navigate to your project's Project File.
    2. From your target’s General pane, under Frameworks, Libraries, and Embedded Content, click the + button.
    3. Select Add Other.
    4. Select Add Package Dependency.
  3. Enter the package URL, https://github.com/jwplayer/JWPlayerKit-package.git.

See Apple's documentation for further details.



Package.swift

In the Package.swift file, add the JWPlayerKit dependency.

dependencies: [
    .package(url: "https://github.com/jwplayer/JWPlayerKit-package.git", .upToNextMajor(from: "4.16.0"))
]

© 2007- Longtail Ad Solutions, Inc.