bright, fresh software
Downloads  |  Buy

Custom license features

License features are custom fields you can add when you generate product keys. After the user has activated, you can read the feature values within your app.

You can use these features to limit parts of your app, license individual components or modules, time-limit your app or individual parts of it, etc. There are no bounds to what you can do with license features.

With license features you have absolute control over every piece of your app.

Adding a new feature

Adding features is as simple as clicking the "License features" link on your dashboard or on the sidebar:

Version Sidebar

You'll be presented with a features page where you add, edit, and remove your custom features for that version of your software.

Adding a new custom license feature

Type of feature

Generating a product key with your custom license featuresThere are 3 basic types of features: strings, dates and times, and integers.

String

Strings are the default feature type. You can store any data you want in the string feature types — there's no limitation.

Date / Time

The Date / Time feature types are stored in the form YYYY-MM-DD hh:mm:ss. If you're entering the feature data using LimeLM, you'll get a nice date / time picker shown to the right. If you're using web API then you must make sure the data is in the form YYYY-MM-DD hh:mm:ss.

Integer

With the integer license feature type you're limited to entering only integers.

How to use license features in your app

When a user activates your app the features data is sent along with signed activation data. This means as soon as a user has activated you can use the TurboActivate function GetFeatureValue() to get the feature value.

There are many ways you can use license features in your application, here are just 2 examples:

Example: Optional components

A common use of license features is to make it easy to sell sub-modules or components to your customer. For instance, let's say you're selling your main app "YourApp" and 2 optional subcomponents "ExtensionX" and "ExtensionY". In this example we're going to keep it simple and just say the extensions can either be enabled or disabled.

  1. If you haven't already, add your product to LimeLM.
  2. Create a new feature with the name "ExtensionX", the type of "String", and leave the "Required feature" checkbox checked.
  3. Do the same for "ExtensionY".

Now, when you create product keys for "YourApp" either using the LimeLM interface or the limelm.pkey.generate web API function then you'll have to set your 2 custom feature values "ExtensionX" and "ExtensionY". In this example let's say you set the extension to either "true" or "false".

Inside your application you can read the feature value to see if the extensions are enabled. That is, to see if the users have purchased your components use the GetFeatureValue() function. A simple example in C# looks like this:

if (TurboActivate.GetFeatureValue("ExtensionX") == "true")
{
    // the user has purchased your ExtensionX
    //TODO: enable the extension
}
else
{
    // tell the user that they can buy ExtensionX on your website
}

Changing features

If you change the feature data for a product key (either within your LimeLM dashboard or using the limelm.pkey.setDetails web API function) then LimeLM will automatically send this new feature data to your customer when the re-Activate. To detect whether the feature data has changed, simply call the IsGenuine() function. If IsGenuine() returns TA_E_REACTIVATE then either the hardware has changed or there are new feature values. Either way you should then force re-activation within your application using the Activate() function.

Example: Customer purchasing an optional component

Let's continue with the example from above. In this example let's also say that a customer purchases "YourApp" but doesn't initially buy your optional components (ExtensionX or ExtensionY). Then after using your program a while, the customer decides to buy your "ExtensionX" optional component.

Here's how you handle the subtleties of enabling optional components for a customer:

Step 1: Purchase page changes

The first thing you need to do is either create a new purchase page that allows users to purchase components for their existing licenses, or modify your existing purchase page to accept the customer's product key for upgrades.

Step 2: Modify the feature's for the customer's product key

Now that the customer has purchased your optional component "ExtensionX" you will have to edit the product key to enable the "ExtensionX" license feature. You can either manually edit the product key in your LimeLM dashboard. Or you can use the limelm.pkey.setDetails web API function to set the new feature value.

Step 3: Re-Activate your app

After the user has purchase the new component and you've set the feature value for the customer's product key, now you just have to get this latest feature value to your customer. The way you do this is to call the "Activate()" function. This will re-Activate the customer and download the latest feature value data.

Get/Set license features using the web API

When you use either the limelm.pkey.generate or limelm.pkey.setDetails web API functions you can set the feature values by using the feature_name[] and feature_value[] arguments. For example let's say you have 2 features that you want to set:

To generate a product key you would urlencode the feature names and values as follows:

...?method=limelm.pkey.generate&feature_name[]=first_feature&feature_value[]=professional&feature_name[]=update_expires&feature_value[]=2012-06-25%2004%3A13%3A16