Kofax Mobile SDK API Reference
Instance Methods | Class Methods | Properties | List of all members
kfxKUTLicensing Class Reference

License for unlocking library features. More...

#import <kfxKUTLicensing.h>

Inheritance diagram for kfxKUTLicensing:

Instance Methods

(int) - setMobileSDKLicense:
 Sets the SDK usage license. More...
 
(void) - setMobileSDKLicenseServer:type:
 Set up the SDK license server. More...
 
(void) - acquireVolumeLicenses:withCount:
 Preallocate volume licenses for offline operation. More...
 
(int) - getRemainingLicenseCount:
 Get remaining license count. More...
 

Class Methods

(int) + isSdkLicensed:
 Checks if the SDK has been licensed for a specific feature. More...
 

Properties

id< kfxKUTAcquireVolumeLicenseDelegatedelegate
 
id< kfxKUTCustomAcquireVolumeLicenseDelegatecustomAcquireVolumeLicenseDelegate
 The custom acquire licenses delegate. More...
 
id< kfxKUTCertificateValidatorDelegatecertificateValidatorDelegate
 The certificate validator delegate. More...
 
int daysRemaining
 Indicates the number of days before the license expires. More...
 

Detailed Description

License for unlocking library features.

An instance of this class contains the properties and methods you must use to set the usage license. Once you set your usage license, you can use included properties to determine the license end date. Once you set the license, other library API methods work as designed. The license remains valid while the app is still running.

Classes that contain licensed methods will include a description that highlights that it is a license protected class. Certain methods in that object are protected by this license mechanism. If you attempt to use the instance methods without setting the license, then you will receive the KMC_IP_LICENSE_INVALID error code in most cases. Refer to the method descriptions within the class to determine what methods are license protected. You use the setMobileSDKLicense method on the kfxKUTLicensing object to set the license.

Examples of licensed classes include kfxKEDImage and kfxKENImageProcessor.

Method Documentation

- (void) acquireVolumeLicenses: (kfxKUTLicenseFeature licenseType
withCount: (int)  count 

Preallocate volume licenses for offline operation.

The function is used to preallocate volume licenses for offline operation.

Parameters
licenseTypeVolume license type.
countNumber of volume license requested.

Example code follows showing how to preallocate volume licenses for offlince operation.
#import <kfxLibUtilities/kfxUtilities.h>
NSString * myTestLicenseServer = nil;
myLicense = [[kfxKUTLicensing alloc] init]; // create the licensing object
myTestLicenseServer = [NSString stringWithFormat: @"%s","http://licenseserver.example.com"];
[self.myLicense setMobileSDKLicenseServer:myTestLicenseServer type:SERVER_TYPE_RTTI]; //set the license server
[self.myLicense acqureVolumeLicenses:LIC_ON_DEVICE_EXTRACTION withCount:20 //preallocate 20 volume licenses
- (int) getRemainingLicenseCount: (kfxKUTLicenseFeature licType

Get remaining license count.

The function will return available license count for the offline operation

Parameters
licTypeVolume license type to check.
Returns
this method returns count of volume license acquired.

Example code follows showing how to get remaining license count.
#import <kfxLibUtilities/kfxUtilities.h>
NSString * myTestLicenseServer = nil;
myLicense = [[kfxKUTLicensing alloc] init]; // create the licensing object
myTestLicenseServer = [NSString stringWithFormat: @"%s","http://licenseserver.example.com"];
[self.myLicense setMobileSDKLicenseServer:myTestLicenseServer type:SERVER_TYPE_RTTI]; //set the license server
[self.myLicense acqureVolumeLicenses:LIC_ON_DEVICE_EXTRACTION withCount:20]; //preallocate 20 volume licenses
NSLog(@"Remain licenses %d", [self getRemainlingLicenseCount:LIC_ON_DEVICE_EXTRACTION]);
+ (int) isSdkLicensed: (kfxKUTLicenseFeature feature

Checks if the SDK has been licensed for a specific feature.

Some license keys may only unlock a subset of features within the SDK. This method is for checking whether a particular feature is available after a license has been successfully applied. If a valid license hasn't been set, this method will return KMC_EV_LICENSING for all features. If a license has been set that is not feature-restricted, this method will return KMC_SUCCESS for all features.

Parameters
featureThe feature being tested.
Returns
KMC_SUCCESS if the feature is licensed, or KMC_EV_LICENSING if the feature is unlicensed or an internal error has occured.
- (int) setMobileSDKLicense: (NSString *)  license

Sets the SDK usage license.

The input to this method is the VRS license string. If the license string is valid and days remain in the license, this method returns KMC_SUCCESS, and sets the daysRemaining property to the number of days remaining in the license. If the license string is valid but no days remain in the license, this method returns KMC_IP_LICENSE_EXPIRED. If the license string is not valid, this method returns KMC_IP_LICENSE_INVALID. Any failure to set the license sets the daysRemaining property to zero.

Parameters
licenseis the valid license string that was contained in a distributed header file that you received from Kofax.
Returns
This method returns an error code if the license string is invalid, or KMC_SUCCESS if the license was setup correctly. The error codes include:
  • KMC_IP_LICENSE_INVALID if the license string used is nil.
  • EVRS_IP_LICENSING_FAILURE if the license string is invalid for setting a license.
  • EVRS_IP_LICENSE_EXPIRATION_ERROR if the time limit of your license has expired.


    Example code follows showing how to set your license.
#import <kfxLibUtilities/kfxUtilities.h>
#import "kfxEVRS_License.h" // the file Kofax distributes
NSString * myTestLicense = nil;
myLicense = [[kfxKUTLicensing alloc] init]; // create the licensing object
myTestLicense = [NSString stringWithFormat: @"%s",PROCESS_PAGE_SDK_LICENSE]; // get the license from the distributed license.h file
error = [self.myLicense setMobileSDKLicense:myTestLicense]; // set the license
if (error != KMC_SUCCESS)
{
NSString *msg = [kfxError findErrMsg: error];
NSString *desc = [kfxError findErrDesc:error];
NSLog(@"License error: %@\n%@",msg,desc);
NSLog(@"License INVALID");
NSLog(@"Days remain: %d",[myLicense daysRemaining]);
}
else
{
NSLog(@"License valid");
NSLog(@"Days remain: %d",[myLicense daysRemaining]);
}
- (void) setMobileSDKLicenseServer: (NSString *)  licenseServerUrl
type: (kfxKUTLicenseServerType serverType 

Set up the SDK license server.

The function is used to setup the url string of license server used for on device operation licensing. Application must call this function before any on device operation that requires license.

Parameters
licenseServerUrlshould be a valid url string of the on device operation licensing server.
serverTypeshould be one of the server type from the kfxKUTLicenseServerType enum.

Example code follows showing how to set your license server.
#import <kfxLibUtilities/kfxUtilities.h>
NSString * myTestLicenseServer = nil;
myLicense = [[kfxKUTLicensing alloc] init]; // create the licensing object
myTestLicenseServer = [NSString stringWithFormat: @"%s","http://licenseserver.example.com"];
[self.myLicense setMobileSDKLicenseServer:myTestLicenseServer type:SERVER_TYPE_RTTI]; // set the license server
myLicense.delegate = self;

Property Documentation

- (id<kfxKUTCertificateValidatorDelegate>) certificateValidatorDelegate
readwritenonatomicweak

The certificate validator delegate.

The delegate receives certificate validation challenge in response to an authentication request from the remote server.

See also
kfxKUTCertificateValidatorDelegate
- (id<kfxKUTCustomAcquireVolumeLicenseDelegate>) customAcquireVolumeLicenseDelegate
readwritenonatomicweak

The custom acquire licenses delegate.

The delegate receives the request from SDK and would have the compeltion handler that user should call for sending the response back. For adding your own custom server to fetch licenses, the user must set this delegate. And while setting this licenseServerUrl in the below api call is optional and serverType is mandatory -(void)setMobileSDKLicenseServer: (NSString*) licenseServerUrl type:(kfxKUTLicenseServerType) serverType

See also
kfxKUTCustomAcquireVolumeLicenseDelegate
- (int) daysRemaining
readatomicassign

Indicates the number of days before the license expires.

After you set the license, this field indicates how many days are left in your license. The library initializes this value to 0.

- (id<kfxKUTAcquireVolumeLicenseDelegate>) delegate
readwritenonatomicweak

The documentation for this class was generated from the following file:
Untitled Document © 2018 Kofax, Inc. All rights reserved. Use is subject to license terms.