Skip to content

Apply the License Key

ComPDFKit for React Native is a commercial SDK, which requires a license to grant developer permission to release their apps. Each license is only valid for one bundle ID or applicationId in development mode. Other flexible licensing options are also supported, please contact our marketing teamto know more.

To initialize ComPDFKit using a license key, call either of the following before using any other ComPDFKit APIs or features:

  • Online certification
tsx
import { ComPDFKit } from '@compdfkit_pdf_sdk/react_native';

type Props = {};
export default class App extends Component<Props> {
  ...
  
  componentDidMount(){
    // Fill in your online license
    ComPDFKit.initialize('your android platform compdfkit license', 'your ios platform compdfkit license')
  }
  // ...
}
  • Offline authentication
tsx
import { ComPDFKit } from '@compdfkit_pdf_sdk/react_native';

type Props = {};
export default class App extends Component<Props> {
  ...

  componentDidMount(){
    // Fill in your offline license
    if(Platform.OS == 'android') {
      ComPDFKit.init_('your compdfkit license for android')
    } else {
      ComPDFKit.init_('your compdfkit license for ios')
    }
  }
// ...
}