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:

  1. In Xcode, open AppDelegate.swift.

  2. Import JWPlayerKit into this file and into any file that will need access to the SDK.

    import JWPlayerKit
    
  3. Set the player license key by calling the JWPlayerKitLicense method setLicenseKey in application: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
    }