Adding the Nutrient license key

Nutrient iOS SDK is a commercial product and uses a license key to verify your copy against the bundle identifier you registered. If you’d like to purchase a license, get in touch.

Generating your license key

To use a Nutrient license with your app, you have to generate a license key and bind it to the bundle ID of your app.

  1. Sign in to the Nutrient Portal(opens in a new tab) using the credentials you received when purchasing Nutrient. Go to the list of your purchased licenses.
  2. Locate your license and click MANAGE.
  3. Scroll down to the Assigned Bundle Identifiers section and use the button to assign the license key. A dialog will open.
  4. Enter the bundle ID of your production app. If you’re unsure about this step, read our what is a bundle ID? guide first.
  5. Click next and confirm your selected bundle ID. Double-check that the chosen identifier matches the one configured in your app, as it can no longer be changed once it’s been set.

Viewing your license key

  1. Sign in to the Nutrient Portal(opens in a new tab) using the credentials you received when purchasing Nutrient. Go to the list of your purchased licenses.
  2. Locate your license and click MANAGE.
  3. Scroll down to the Assigned Bundle Identifiers section and click LICENSE KEY next to the bundle ID you want the license for.
  4. A dialog will open showing you a code snippet with your license key.
  5. Paste the the license key into your project as shown in the next section.

Using your license key

Set the license key at app launch:

@main
struct MyApp: App {
init() {
PSPDFKit.SDK.setLicenseKey("YOUR_LICENSE_KEY_GOES_HERE")
}
var body: some Scene {
...
}
}

It’s important that you set the license key before using any other Nutrient APIs; otherwise, Nutrient will run in evaluation mode, which adds watermarks to documents and terminates the app after 60 minutes.

Don’t load the license key remotely or write conditional code based on your Nutrient license expiration date. If your hardcoded license key works when you test your app, it will continue working in that build of your app in production. When your license key has been renewed, use the new license key the next time you update your app.