Developer Zone

SDK Configuration

Before an application can start reporting usage to the Revulytics Usage Intelligence SDK, it must first provide some basic information such as the location of where the SDK will create and save its working files, the application Product ID and the CallHome URL.

You should always attempt to fill in as much accurate and specific details as possible since this data will then be used by the Revulytics Usage Intelligence Analytics Server to generate the relevant reports. The more (optional) details you fill in about your product and its licensing state, the more filtering and reporting options will be available to you inside the Revulytics Usage Intelligence Analytics portal.

Getting SDK Version Information

String GetSdkVersion ()

This function returns the SDK Version String for this Revulytics Usage Intelligence SDK Instance. The SDK Version String contains the following formatted information:

Revulytics Usage Intelligence SDK version [VER_NUM] for [PLATFORM]/[SHIM]
Where:
  * VER_NUM      is X.Y.Z  (currently 4.0.7)
  * PLATFORM     is WINDOWS, OSX, or LINUX
  * SHIM         is only provided if using a shim layer and if provided will be either C, ObjC, or .NET

IMPORTANT: Do not call tbFree() with the pointer to the Revulytics Usage Intelligence SDK version.

Return Type:

Formatted string in form of “Revulytics Usage Intelligence SDK version [VER_NUM] for [PLATFORM]/[SHIM]” where:

* VER_NUM      is X.Y.Z  (currently 4.0.7)
* PLATFORM     is WINDOWS, OSX, or LINUX
* SHIM         is only provided if using a shim layer and if provided will be either C, ObjC, or .NET

Setting the data path

GenericReturn TBClass.SetFilePath (String filePath)

This method sets the file path where the Revulytics Usage Intelligence SDK will create and save its working files. It is important to remember that the calling process should have read/write accessibility to the location.

IMPORTANT - This function needs to be called BEFORE any other method - including TBClass.CreateConfig.

Parameters:

filePath (string) - The location where to create and save the Revulytics Usage Intelligence SDK working files.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* InvalidPath (-10)
* AccessDenied (-11)
* InternalError (-99)

Initializing the configuration

Before calling any other method other than SetFilePath, the TBClass.CreateConfig method must be called in order to initialize the configuration. The method signature is as follows:

GenericReturn TBClass.CreateConfig (String url, String productId, String productVersion, String productBuildNumber, bool multiSessionEnabled)
Parameters:
url (string) - CallHome URL: Every product registered with Revulytics Usage Intelligence has its own unique CallHome URL

usually in the form ‘http://xxxxx.tbnet1.com’. This URL is generated automatically on account creation and is used by the SDK to communicate with the Revulytics Usage Intelligence server. You can get this URL from the Developer Zone once you login to the customer area. If you have a Premium product account you may opt to use your own custom CallHome URL (such as http://updates.yourdomain.com) that must be setup as a CNAME DNS entry pointing to your unique Revulytics Usage Intelligence URL. Please note that before you can use your own custom URL you must first inform Revulytics Revulytics Usage Intelligence support (support-tb@vialbs.com) to register your domain with the Revulytics Usage Intelligence server. If you fail to do this, the server will automatically reject any incoming calls using yourdomain.com as a CallHome URL.

IMPORTANT: Once you call this method for the first time, a configuration file (tbconfig.xml) is created. This contains most configuration values including the URL. Once this file is created, the URL passed in this method is ignored, and the one inside the config file is used. This is done so that the server can instruct the Revulytics Usage Intelligence SDK to start using a new URL in cases of URL change. Also, every Revulytics Usage Intelligence product has a unique URL. Therefore, if during testing you use a product account and then you register another product ID for production, it is important that you delete all Revulytics Usage Intelligence data files or else, the clients will keep trying to use the old URL that won’t match the new product ID.

IMPORTANT - The URL should start with http://

productID (string) - This is a unique 10-digit Product ID number that identifies your product with
the Revulytics Usage Intelligence server. You can get this ID from the Developer Zone once you login to the customer area.

productVersion (string) - The version number of the application being run.

productBuildNumber (string) - The build number of the application being run.

multiSessionEnabled (bool) - Whether multiple user sessions can be present in a single application runtime. Refer to Single vs. Multiple session modes.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigAlreadyCreated (-6)
* InvalidParameter (-9)
* FilePathNotSet (-13)
* InternalError (-99)

Single vs. Multiple session modes

In desktop software, a single application instance would normally have only one single user session. This means that such an application would only show one window (or set of windows) to a single user and interaction is done with that single user. If the user would like to use two different sessions, two instances of the application would have to be loaded that would not affect each other. In such cases, you should use the single session mode, that handles user sessions automatically and assumes that one process (instance) means one user session.

The multiple session mode needs to be used in multi-user applications, especially applications that have web interfaces. In such applications, a number of users might be using the same application process simultaneously. In such cases, you need to manually tell the Revulytics Usage Intelligence SDK when user sessions start and stop, and also how to link events (see Feature / Event Tracking) to user sessions. To do this, when starting or stopping a user session, the methods TBClass.SessionStart and TBClass.SessionStop should be used, and when tracking events, a session ID needs to be passed as a parameter.

Providing further data

Apart from the four compulsory parameters that must be passed to TBClass.CreateConfig, there are a number of methods meant to provide further data to the SDK that would either help generate better reports such as by providing the product language or edition name, or else set some configuration that might be required on some setups such as the proxy server settings.

License Management

GenericReturn TBClass.SetLicense (KeyType? keyType, bool? keyExpired, bool? keyActivated, bool? keyBlacklisted, bool? keyWhitelisted)

This method is used to set the type of license key being used by the client and the 4 license status flags. Although this function accepts 5 parameters, it can be used to set any subset of these values. If a value is not to be changed, a null value should be sent as its corresponding parameter.

Parameters:

keyType (Keytype?) - One of the key types from the KeyType enum. Note that customer types can be used for application specific license types:

* Evaluation (0)
* Purchased (1)
* Freeware (2)
* Unknown (3)
* NFR (4) // Not For Resale
* Custom1 (5)
* Custom2 (6)
* Custom3 (7)

keyExpired (bool?) - Indicates whether the client license has expired.

keyActivated (bool?) - Indicates whether the client license has been activated.

keyBlacklisted (bool?) - Indicates whether the client license key has been blacklisted.

keyWhitelisted (bool?) - Indicates whether the client license key has been whitelisted.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigNotCreated (-5)
* InternalError (-99)

Product Details

GenericReturn TBClass.SetProductEdition (String productEdition)

This method allows you to set the edition of your product. An example of this would be when a single product can be licensed/run in different modes such as as “Home” and “Business”.

Parameters:

productEdition (string) - The product edition that is to be set.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigNotCreated (-5)
* InvalidParameter (-9)
* InternalError (-99)

GenericReturn TBClass.SetProductLanguage (String productLanguage)

This method allows you to set the language in that the client is viewing your product. This is useful for products that have been internationalized, so you can determine how many installations are running your software in a particular language. Please note this is different than the OS language that is collected automatically by the Revulytics Usage Intelligence SDK.

Parameters:

productLanguage (string) - The product language that is to be set.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigNotCreated (-5)
* InvalidParameter (-9)
* InternalError (-99)

GenericReturn TBClass.SetProductVersion (String productVersion)

This method is used to set the version number of the application being run. In most cases, this property would already have been set when calling CreateConfig. So, this function normally only needs to be used if the version number changes during runtime such as after an update.

Parameters:

productVersion (string) - The product version number that is to be set.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigNotCreated (-5)
* InvalidParameter (-9)
* InternalError (-99)

GenericReturn TBClass.SetProductBuildNumber (String productBuildNumber)

This method is used to set the build number of the application being run. In most cases, this property would already have been set when calling CreateConfig. So, this function normally only needs to be used if the build number changes during runtime such as after an update.

Parameters:

productBuildNumber (string) - The product build number that is to be set.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigNotCreated (-5)
* InvalidParameter (-9)
* InternalError (-99)

Environment-specific Settings

GenericReturn TBClass.SetProxy (String address, String username, String password)

This method allows you to set specific proxy settings that the SDK will use from the end user’s machine to connect to the Revulytics Usage Intelligence server. Please note that unless a proxy server is specified using this method, the Revulytics Usage Intelligence SDK will always use the default Windows settings as defined on Internet Explorer.

Parameters:

address (string) - The address of the HTTP proxy server where SDK communication must
pass. You may set this value to an empty string in order to discard a previously set proxy address and use the default Windows settings as defined in IE.

username (string) - If authentication is required pass the username here, otherwise use an empty string.

password (string) - If a password is required for the connection it should be passed here. If a
password is not required you can set this value to an empty string. Note that the password is not saved to disk and must be passed again once the application is restarted.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* InvalidParameter (-9)
* InternalError (-99)

Code Example:

// Create instance
TBClass tb = new TBClass("<path to Revulytics Usage Intelligence SDK .NET library>");
// Other initialization.....

tb.SetProxy("192.168.1.250:8080", "TestUser", "TestPassword");

GenericReturn TBClass.SetDefaultProxyCredentials (String username, String password)

This method is used in case the application is running behind an HTTP proxy that requires authentication (usually verified through TBClass.ConnectionCheck). It enables you to set the proxy username and password that will be used by the SDK to authenticate with the default Windows proxy server defined on the Internet Explorer settings. If the end-user does not have a default proxy server defined, then these credentials are simply ignored.

Conventionally, web-enabled applications usually ask the user to enter these credentials by displaying a dialogue or having a proxy settings section inside the application. Once you get the username and password from the user you can pass them on to the Revulytics Usage Intelligence SDK through this method.

Parameters:

username (string) - If authentication is required pass the username here, otherwise use an empty string.

password (string) - If a password is required for the connection it should be passed here. If a
password is not required you can set this value to an empty string. Note that the password is not saved to disk and must be passed again once the application is restarted.

Return Type:

GenericReturn enum value with the following possible values:

* OK (1)
* ConfigNotCreated (-5)
* InvalidParameter (-9)
* InternalError (-99)

Code Example:

// Create instance
TBClass tb = new TBClass("<path to Revulytics Usage Intelligence SDK .NET library>");
// Other initialization.....

tb.SetDefaultProxyCredentials("Testuser", "Pass123");