Cryptlex Documentation
  • Welcome to Cryptlex!
  • Getting Started
    • Overview
    • Licensing Models
  • License Management
    • License Templates
    • Implementing License Models
    • Creating Licenses
    • License Subscriptions
    • Custom License Fields
    • Meter Attributes
    • Suspending Licenses
    • Revoking Licenses
    • Maintenance Policies
  • Feature Management
    • Overview
    • Features and Entitlement Sets
    • License Feature Entitlements
    • Accessing Feature Entitlements
    • Use Cases
  • User Management
    • Roles
    • Creating Users
    • Authenticating Users
    • Organizations
    • Resellers
    • Customer Portal
    • Reseller Portal
    • Google SSO
    • SAML SSO
  • 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 a verified trial to your app
  • Extending trials
  • Getting trial id
  • Extending trial
  • Re-activate the trial
  1. Timed Trials

Verified Trials

Verified trials are also node-locked. It ensures that trial doesn't reset even if user formats the machine. Each verified trial activation appears in the admin portal in the Trials -> Trial Activations section.

Adding a verified trial to your app

When your user installs your application for the first time, invoke ActivateTrial() LexActivator API functions to start the trial. The following sample code should be executed once after the user installs your app, ideally on a button click. Executing multiple times would unnecessarily re-validate the trial by contacting Cryptlex servers.

int status;
status = SetTrialActivationMetadata("key1", "value1");
if (LA_OK != status)
{
	// handle error
}
status = ActivateTrial();
if (LA_OK == status)
{
	printf("Product trial activated successfully!");
}
else if (LA_TRIAL_EXPIRED == status)
{
	printf("Product trial has expired!");
}
else
{
	printf("Product trial activation failed: %d", status);
}

Once the trial is started you only need to invoke IsTrialGenuine() and GetTrialExpiryDate() LexActivator API functions at the start of your app after IsLicenseGenuine() check. Following is the sample code:

int trialStatus;
trialStatus = IsTrialGenuine();
if (LA_OK == trialStatus)
{
	unsigned int trialExpiryDate = 0;
	GetTrialExpiryDate(&trialExpiryDate);
	int daysLeft = (trialExpiryDate - time(NULL)) / 86500;
	printf("Trial days left: %d", daysLeft);
}
else if (LA_TRIAL_EXPIRED == trialStatus)
{
	printf("Trial has expired!");
}
else
{
	printf("Either trial has not started or has been tampered!");
	// Activate the trial
}

If IsTrialGenuine() does not return a success code you should re-activate the trial.

Extending trials

You can easily extend the trials so that your customers can get more time to evaluate your product. The trial extension has three steps:

Getting trial id

You need to get the trial id from your customer. To get the trial id in your app you need to invoke GetTrialId() LexActivator API function.

Extending trial

Go to Trials -> Trial Activations section in the admin portal. Paste the "trial id" in the search to find the trial activation.

Then click the "Extend" option in the actions menu. The trial extension form will pop up, add the extension length to extend the trial.

Re-activate the trial

In your app you need to call ActivateTrial() function again, this would extend the trial in user's machine.

PreviousTimed TrialsNextUnverified Trials

Last updated 1 month ago