Configure your project

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.


Swift

  1. In Xcode, open AppDelegate.swift.
  2. Set the player license key by calling the JWPlayerKitLicense method setLicenseKey in application:didFinishLaunchingWithOptions.
func application(_ application: UIApplication, 
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?) -> Bool {
    JWPlayerKitLicense.setLicenseKey("YOUR_KEY_HERE") 
    return true
}

📘

TIP

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.


  1. Import JWPlayerKit into any file that will need access to the SDK.
import JWPlayerKit

You have configured your project. You can now set up a player.



Objective-C

  1. In Xcode, open AppDelegate.m.
  2. Set the player license key by calling the JWPlayerKitLicense class method setLicenseKey in application:didFinishLaunchingWithOptions.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [JWPlayerKitLicense setLicenseKey:@"YOUR_KEY_HERE"]; 
    return YES; 
}

📘

TIP

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.


  1. Import JWPlayerKit-swift.h into any file that will need access to the SDK.
#import <JWPlayerKit/JWPlayerKit-swift.h>

You have configured your project. You can now set up a player.



Did this page help you?