Online Licenses
The SDK provides support for online license activation, check, and deactivation. This flow requires internet access and communicates directly with the LicenseSpring API.
To begin working with an online license, you must initialize a LicenseHandler using your product and license credentials:
When using OAuth, you must provide a CryptoProviderKey, which is required to securely encrypt and decrypt the license data.
By default, this setup uses the SDK’s file-based storage, meaning license data is persisted to a local file. You can customize the storage method if needed, but all examples in this guide assume file storage.
Once the license handler is configured, activate the license:
This will send an activation request to the LicenseSpring API. If successful, the SDK stores the license locally for future use.
After activation, you can verify the license status at any time:
This communicates with the API to ensure the license is still valid and up-to-date.
To deactivate the license when no longer needed:
Setting removeLocalData to true will delete the local license file. If set to false, the file remains and can be reused later.
If your application restarts and you haven't removed the local license file, you can resume the license state from disk:
- Online licenses require internet connectivity at the time of activation and checks.
- Local license data can be reused as long as it hasn’t been removed or expired.