Cryptlex Documentation
  • Welcome to Cryptlex!
  • Getting Started
    • Overview
    • Licensing Models
  • License Management
    • License Templates
    • Implementing License Models
    • Custom License Fields
    • Meter Attributes
    • Creating Licenses
    • Renewing Licenses
    • Extending Licenses
    • Suspending Licenses
    • Revoking Licenses
    • Maintenance Policies
  • User Management
    • Roles
    • Creating Users
    • Authenticating Users
    • Organizations
    • Resellers
    • Customer Portal
    • Reseller Portal
    • Google SSO
    • SAML SSO
  • Feature Management
    • Overview
    • Feature Flags and Product Versions
    • Use Cases
    • Creating Product Versions
  • Release Management
    • Overview
    • Creating Releases
    • Distributing Releases
  • Node Locked Licenses
    • Overview
    • Using LexActivator
      • Using LexActivator with C, C++ and Objective C
      • Using LexActivator with C#
      • Using LexActivator with VB.NET
      • Using LexActivator with Java
      • Using LexActivator with Delphi
      • Using LexActivator with Python
      • Using LexActivator with Go
      • Using LexActivator with Node.js
      • Using LexActivator with Ruby
      • Using LexActivator with Android
      • Using LexActivator with iOS
      • Using LexActivator with Flutter
    • Using Web API
    • Offline Activations
    • Proxies and Firewall
  • Floating Licenses
    • Overview
    • Hosted Floating License Server
    • On-Premise Floating Licenses
      • LexFloatServer
      • Using LexFloatClient
        • Using LexFloatClient with C, C++ & Objective C
        • Using LexFloatClient with C#
        • Using LexFloatClient with VB.NET
        • Using LexFloatClient with Java
        • Using LexFloatClient with Delphi
        • Using LexFloatClient with Python
        • Using LexFloatClient with Node.js
        • Using LexFloatClient with Go
        • Using LexFloatClient with Android
        • Using LexFloatClient with iOS
      • Offline Floating License
  • Named User Licenses
  • Timed Trials
    • Verified Trials
    • Unverified Trials
  • Licensing Docker Apps
  • Webhooks
  • Automated Emails
  • Web Integration
    • Personal Access Tokens
    • Using Web API
    • Using Zapier
    • Using FastSpring
    • Custom Development
  • Changelog
    • Web API
    • LexActivator
    • LexFloatClient
    • LexFloatServer
  • Legal
    • Terms of Service
    • Privacy Policy
    • Subprocessors
    • Data Processing Addendum
    • Service Level Agreement
    • Security, Privacy, and Compliance
    • Open Source Licenses
  • Cryptlex On-Premise
    • Overview
    • System Requirements
    • Server Layout
    • Installation Guide
      • Docker Compose
      • Kubernetes
    • Configuring Client Libraries
    • Monitoring and Error Reporting
Powered by GitBook
On this page
  • Adding licensing to your app
  • Adding the library to your app
  • Setting product id
  • Requesting floating license
  • Renewing floating license
  • Dropping floating license
  • Need more help
  1. Floating Licenses
  2. On-Premise Floating Licenses
  3. Using LexFloatClient

Using LexFloatClient with iOS

PreviousUsing LexFloatClient with AndroidNextOffline Floating License

Last updated 9 months ago

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

Adding licensing to your app

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 example project from .

The product id is the identifier of your product that is to be used in the code. The product id of the LexFloatServer and LexFloatClient must match.

Adding the library to your app

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.

Setting product id

The first LexFloatClient API function you need to use in your code is SetHostProductId(). It sets the product id of the product you will be adding licensing to.

SetHostProductId("PASTE_PRODUCT_ID");

Requesting floating license

To receive a floating license, you will use SetHostUrl(), SetFloatingLicenseCallback() and RequestFloatingLicense()LexFloatClient API methods. It sets the LexFloatServer address, the callback for status notifications, contacts the server and receives the floating license.

int status;
status = SetHostProductId(L"PASTE_PRODUCT_ID");
if(LF_OK != status)
{
	// handle error
}
status = SetHostUrl("http://localhost:8090");
if(LF_OK != status)
{
	// handle error
}
status = SetFloatingLicenseCallback(LicenceRenewCallback);
if(LF_OK != status)
{
	// handle error
}
status = RequestFloatingLicense();
if(LF_OK != status)
{
	// handle error
}
printf("License leased successfully!");

The above code can be executed every time user starts the app or needs a new license.

Renewing floating license

License lease automatically renews itself in a background thread. When a license is renewed or fails to renew, the callback is invoked (from the background thread).

void LF_CC LicenceRenewCallback(uint32_t status)
{
    switch (status)
	{
	case LF_OK:
		printf("The license lease has renewed successfully.\n");
		break;
	case LF_E_LICENSE_NOT_FOUND:
		printf("The license expired before it could be renewed.\n");
		break;
	case LF_E_LICENSE_EXPIRED_INET:
		printf("The license expired due to network connection failure.\n");
		break;
	default:
		printf("The license renew failed due to other reason. Error code: %d\n", status);
		break;
	}
}

Dropping floating license

When your user is done using the app, the app should send a request to free the license, thereby making it available to other users. If the app doesn't, the license becomes useless (zombie) until lease time is over.

int status;
status = DropFloatingLicense();
if(LF_OK != status) 
{
	// handle error
}
else 
{
    printf("Success! License dropped.");
}

The above code should be executed every time user closes the app.

Need more help

In case you need more help with adding LexFloatClient 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 .

Download LexFloatClient for iOS
Github
support forum
email