Atalasoft MobileImage 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...
 

Class Methods

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

Properties

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

◆ isSdkLicensed:()

+ (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.

◆ setMobileSDKLicense:()

- (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]);
}

Property Documentation

◆ daysRemaining

- (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.


The documentation for this class was generated from the following file:
Untitled Document © 2018 Atalasoft, Inc., 116 Pleasant St, Suite 321, Easthampton, MA 01027, U.S.A. All rights reserved. Use is subject to license terms.