Skip to content

Apply the License Key

If you haven't get a license key, please check out how to obtain a license key.

ComPDFKit PDF SDK currently supports two authentication methods to verify license keys: online authentication and offline authentication.

Learn about:

What is the authentication mechanism of ComPDFKit's license?

What are the differences between Online Authentication and Offline Authentication?

Accurately obtaining the license key is crucial for the application of the license.

Android

  1. In the email you received, locate the XML file containing the license key.

  2. Copy the license_key_rn.xml file into the following directory:android/app/src/main/assets/

  1. Initialize the SDK:
tsx
ComPDFKit.initWithPath('assets://license_key_rn.xml');

iOS

  1. Use Xcode to copy the license_key_rn.xmlfile into your project’s ios/directory.
  1. Initialize the SDK:
tsx
// Copy the license_key_rn_ios.xml file into your iOS project directory (or a readable location):
ComPDFKit.initWithPath('license_key_rn.xml');

Alternative Method

You can also store the License file in the device’s local storage and initialize the SDK using its file path:

tsx
// Obtain the License file through the local storage path of the device for initialization
ComPDFKit.initWithPath('/data/data/0/your_packages/files/license_key_rn.xml');