Configure the SDK

Available on: iOS Android Web React Native Flutter Cordova .NET MAUI

License Key Configuration

The Genius Scan SDK is subject to a commercial license. A license key is required to initialize the SDK across all platforms. The key must match your application identifier (bundle ID for iOS, package name for Android, hostname for Web) and must be valid according to the license’s expiration date.

The SDK can run without a license key but will stop working after 60 seconds. This is useful for testing purposes only.

Please contact us if you don’t have a license key yet. You can also learn more about it in the licensing documentation.

Setting the License Key

Select your platform below to see how to configure the license key:

iOS (Swift)

Initialize the SDK with your license key as early as possible in your app lifecycle:

import GSSDK

// In your AppDelegate or app initialization
GSK.setLicenseKey("YOUR_LICENSE_KEY")

iOS (Objective-C)

#import <GSSDK/GSSDK.h>

// In your AppDelegate
[GSK setLicenseKey:@"YOUR_LICENSE_KEY"];

Android

Initialize the SDK in your Application class or main Activity:

import com.geniusscansdk.core.GeniusScanSDK

// In your Application class or MainActivity
GeniusScanSDK.setLicenseKey(context, "YOUR_LICENSE_KEY")

Web (JavaScript)

Initialize the SDK with your license key before using any SDK features:

import { setLicenseKey } from "@thegrizzlylabs/web-geniusscan-sdk";

// Set the license key
setLicenseKey("YOUR_LICENSE_KEY").catch((e) => {
  console.error(`Error setting Genius Scan SDK license key`, e);
});

Web (Script Tag)

When using the script tag approach:

// The SDK is available globally as GSSDK
GSSDK.setLicenseKey("YOUR_LICENSE_KEY").catch((e) => {
  console.error(`Error setting Genius Scan SDK license key`, e);
});

React Native

Initialize the SDK with your license key:

import RNGeniusScan from '@thegrizzlylabs/react-native-genius-scan';

// Initialize with license key
RNGeniusScan.setLicenseKey('YOUR_LICENSE_KEY', true);

// Note: setLicenseKey doesn't return anything, but other SDK methods
// will fail if the license key is invalid or expired

Flutter

Initialize the SDK with your license key:

import 'package:flutter_genius_scan/flutter_genius_scan.dart';

// Initialize with license key
FlutterGeniusScan.setLicenseKey('YOUR_LICENSE_KEY', true);

Cordova

Initialize the SDK after the deviceReady event:

document.addEventListener('deviceready', function() {
    // Initialize with license key
    cordova.plugins.GeniusScan.setLicenseKey('YOUR_LICENSE_KEY', true);
}, false);

Cordova with Ionic

import { Platform } from 'ionic-angular';

declare var cordova: any;

export class HomePage {
  constructor(private platform: Platform) {
    platform.ready().then(() => {
      cordova.plugins.GeniusScan.setLicenseKey('YOUR_LICENSE_KEY', true);
    });
  }
}

.NET MAUI

Initialize the SDK in your app initialization:

iOS

using GeniusScanSDK.ScanFlow;

GSK.SetLicenseKey("YOUR_LICENSE_KEY", true);

Android

using GeniusScanSDK.ScanFlow;

GSK.SetLicenseKey("YOUR_LICENSE_KEY", true);

License Key Auto-Refresh

Available on: iOS Android React Native Flutter Cordova .NET MAUI

Note: The auto-refresh feature is not currently available for the Web SDK.

On supported platforms, the SDK uses the license key set in your code to automatically refresh your license, ensuring your users always benefit from the SDK features without requiring app updates. This feature is enabled by default on iOS, Android, React Native, Cordova, Flutter, and .NET MAUI.

Benefits of Auto-Refresh

  • Seamless Updates: Your license automatically renews without requiring users to update the app
  • No Downtime: Users continue to use the SDK features without interruption
  • Simplified Management: No need to release app updates just for license renewal

Disabling Auto-Refresh

While we recommend keeping auto-refresh enabled, you can disable it if you prefer to manage license updates manually. When disabled, you’ll need to:

  1. Update the license key in your code when renewed
  2. Release an app update for users to get the new license
  3. Ensure users update before the old license expires

To disable auto-refresh, set the autoRefresh parameter to false when calling setLicenseKey. Here are platform-specific examples:

iOS

// Swift - Disable auto-refresh
GSK.setLicenseKey("YOUR_LICENSE_KEY", autoRefresh: false)
// Objective-C - Disable auto-refresh
[GSK setLicenseKey:@"YOUR_LICENSE_KEY" autoRefresh:NO];

Android

// Kotlin - Disable auto-refresh
GeniusScanSDK.setLicenseKey(context, "YOUR_LICENSE_KEY", autoRefresh = false)

Web

// Web SDK doesn't support auto-refresh
// The license key must be updated manually when renewed
setLicenseKey("YOUR_LICENSE_KEY");

Note: The Web SDK does not support automatic license refresh. You must update the license key in your code and redeploy your web application when your license is renewed.

React Native

// Disable auto-refresh
RNGeniusScan.setLicenseKey('YOUR_LICENSE_KEY', /* autoRefresh = */ false);

Flutter

FlutterGeniusScan.setLicenseKey('YOUR_LICENSE_KEY', /* autoRefresh = */ false);

Cordova

// Disable auto-refresh
cordova.plugins.GeniusScan.setLicenseKey('YOUR_LICENSE_KEY', /* autoRefresh = */ false);

.NET MAUI

// Disable auto-refresh
GeniusScan.SetLicenseKey("YOUR_LICENSE_KEY", autoRefresh: false);

Error Handling

If the license key is invalid or expired, SDK methods will fail with a license error. It’s recommended to:

  1. Catch License Errors: Handle license validation failures gracefully
  2. Inform Users: Display a message asking users to update the app if the license has expired
  3. Provide Fallback: Consider alternative flows for critical functionality

Example error handling:

do {
    let scanFlow = GSKScanFlow(configuration: configuration)
    try await scanFlow.start(from: viewController)
} catch let error as NSError {
    if error.domain == GSKErrorDomain && error.code == GSKErrorCode.licenseError.rawValue {
        // Handle license error
        showAlert("Please update the app to continue scanning documents")
    } else {
        // Handle other errors
    }
}
try {
    ScanFlow.scanWithConfiguration(activity, configuration)
} catch (e: LicenseException) {
    // Handle license error
    showAlert("Please update the app to continue scanning documents")
} catch (e: Exception) {
    // Handle other errors
}
try {
    const result = await scanWithConfiguration(configuration);
} catch (error) {
    if (error.message.includes('license')) {
        // Handle license error
        alert('Please refresh the page to continue scanning documents');
    } else {
        // Handle other errors
    }
}

Testing Without a License

For testing purposes, you can use the SDK without a license key:

  • The SDK will function normally for 60 seconds
  • After 60 seconds, all SDK methods will fail
  • This is useful for initial integration and testing

Getting a License Key

To obtain a license key:

  1. Sign up at sdk.geniusscan.com
  2. Create an application with your app’s identifier
  3. Submit a quote request for your application
  4. Receive your license key via email

For licensing questions or support, contact us at sdk@geniusscan.com.

Next Steps

Once you’ve configured your license key, you’re ready to start implementing the SDK features:

Products

Industries

Case Studies

Integration

Company

© 2025 The Grizzly Labs. All rights reserved.