Configure your project (iOS)
Configure your iOS or tvOS project.
To use the SDK in your project, you must add the player license key and import the JWPlayerKit
or JWPlayerTVKit
module where necessary.
Configure the project
Use the following steps to configure your iOS or tvOS project:
- In Xcode, open AppDelegate.swift.
- Import
JWPlayerTVKit
into this file and into any file that will need access to the SDK.
import JWPlayerKit
import JWPlayerTVKit
- Set the player license key by calling the
JWPlayerKitLicense
methodsetLicenseKey
inapplication:didFinishLaunchingWithOptions
.
For added flexibility, you should consider remotely storing the key and setting it at runtime. This approach enables you to update the license key of the player without needing to resubmit your app to the App Store.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
JWPlayerKitLicense.setLicenseKey("#YOUR_KEY_HERE#")
return true
}
Updated almost 2 years ago
Whatβs Next