Navigation

The Revulytics Usage Intelligence V4 SDK is built to support running Revulytics Usage Intelligence in plug-in type environments. To accomplish this goal,
applications must first instantiate an instance of the Revulytics Usage Intelligence SDK by calling the function tbCreateInstance that
returns a handle to the Revulytics Usage Intelligence SDK instance. All subsequent Revulytics Usage Intelligence API calls required this handle as the first
(or only) parameter.

Before an application can start reporting usage to the Revulytics Usage Intelligence SDK, it must
first provide some basic information such as the Product ID and the CallHome
URL.

You should always fill in as much accurate and specific
detail as possible since this data will 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.

If you would like to store the Revulytics Usage Intelligence data files in a particular directory,
this needs to be specified before initializing the configuration.

This function creates the Revulytics Usage Intelligence SDK instance to be used by the application. All subsequent Revulytics Usage Intelligence
SDK calls use the returned value of the instance handle. This function also allocates the internal resources
for the Revulytics Usage Intelligence SDK instance including memory, threads, locks, and loading any dependent libraries. Calls
to :cpp:func`tbSetFilePath` , tbCreateConfig(), and tbStart() all follow this function.

This function is required to be the last call to a Revulytics Usage Intelligence SDK instance. The function tbDestroyInstance() frees all
Revulytics Usage Intelligence internal resources including memory, threads, locks and any dynamically loaded libraries that the Revulytics Usage Intelligence
SDK loaded. Prior to calling tbDestroyInstance, the application must have called tbStop(). After calling this function,
the tbInstance variable can no longer be used.

NOTE: Do not call function tbFree() with the pointer to the Revulytics Usage Intelligence SDK instance.

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

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 set up 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-rui@revulytics.com) to register your domain.
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 function for the first time, a configuration file (tbconfig.xml)
is created. This contains configuration values including the URL. Once this file is created,
the URL passed in this function is ignored, and the one inside the configuration 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.

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 2 different sessions, 2 instances of the application would have
to be loaded which would not affect each other. In such cases, you should use the single session mode that handles
user sessions automatically and assumes that 1 process (instance) means 1 user session.

The multiple session mode must be used in multi-user applications, especially applications that have web interfaces.
In such applications, many users may be using the same application process simultaneously. In such cases, the Revulytics Usage Intelligence SDK
must be notified when user sessions start, stop and how to link events (see Feature / Event Tracking)
to user sessions. When starting or stopping a user session, the functions tbSessionStart() and tbSessionStop() must
be used. When tracking events on a per user basis a session ID needs to be passed as a parameter.

Apart from the four compulsory parameters that must be passed to tbCreateConfig(),
there are a number of functions meant to provide further data to the SDK that will
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 set ups
such as the proxy server settings.

These functions can also be called during application runtime such as changing
the key type after the user enters a new license key.

This function 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, the value TB_KEY_STATUS_UNCHANGED (-1) should be sent as its corresponding parameter.

The keyType parameter can be set to any of the constant types below. Please note that the 3 custom values may be used freely to
denote your own custom license types.

This function 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”. If using
this function it must be called after tbCreateConfig() .

This function allows you to set the language 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.

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

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

This function, available only on Windows, allows you to set specific proxy
settings that the Revulytics Usage Intelligence 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 function, the Revulytics Usage Intelligence SDK will always
use the default Windows settings as defined on Internet Explorer.

This function, available only on Windows, is used in case the application is running behind an
HTTP proxy that requires authentication (usually verified through tbConnectionCheck()). 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 the application gets the
username and password from the user it can pass them on to the Revulytics Usage Intelligence SDK through this
function.