Using LexActivator with iOS
Last updated
Last updated
First of all, login to your Cryptlex account and download the LexActivator library for iOS:
The above download package contains the library in the .xcframework format. The .xcframework supports the following architectures:
iOS Simulator - x86_64 (Intel), ARM64 (Apple Silicon)
iOS - ARM64
After you've added a product for your app in the admin portal, you will need to do the following things:
Note the product id for the product (from the actions menu in the table).
Download the Product.dat for the product (from the actions menu in the table).
Download the example project from .
Product.dat contains product data that is used by LexActivator. The product id is the identifier of your product that is to be used in the code.
After downloading the library in .xcframework format, just add it to your project in Xcode. You can add the dynamic as well as the static framework depending on your requirements.
The first thing you need to do is either embed the Product.dat file in your app using SetProductData()
function or set the absolute path of the file using SetProductFile()
function.
The next thing you need to do is to set the product id of your application in your code using SetProductId()
function. It sets the id of the product you will be adding licensing to.
To activate the license in your app using the license key, you will use ActivateLicense()
LexActivator API function. It invokes the /v3/activations
Cryptlex Web API endpoint, verifies the encrypted and digitally signed response to validate the license.
The above code should be executed at the time of license activation, ideally on a button click.
Each time, your app starts, you need to verify whether your license is already activated or not. This verification should occur locally by verifying the cryptographic digital signature of activation. Ideally, it should also asynchronously contact Cryptlex servers to validate and sync the license activation periodically. For this, you need to use IsLicenseGenuine()
LexActivator API function.
The above code should be executed every time user starts the app. After verifying locally, it schedules a periodic server check in a separate thread.
In case you need more help with adding LexActivator to your app, we'll be glad to help you make the integration. You can either post your questions on our or can contact us through .