Configure your project (iOS)
Configure your iOS project.
To use the SDK in your project, you must add the player license key and import the JWPlayerKit
module where necessary.
Configure the project
Use the following steps to configure your iOS project:
-
In Xcode, open AppDelegate.swift.
-
Import
JWPlayerKit
into this file and into any file that will need access to the SDK.import JWPlayerKit
-
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 5 months ago