MBMicroblinkSDK

Objective-C


@interface MBMicroblinkSDK : NSObject

Swift

class MBMicroblinkSDK : NSObject

Entry class for all Microblink SDKs - used for setting up license key and to add support for optimisation of passing data.

  • Disable or enable showing of toast when trial license key is entered. By default, whenever someone uses trial license key, a toast will appear informing user that license is trial. This feature should protect you from accidentally using trial license key in production version of your app.

    Default: YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showTrialLicenseWarning;

    Swift

    var showTrialLicenseWarning: Bool { get set }
  • Set license buffer and unlock the SDK. Application package will be used to validate the license.

    Declaration

    Objective-C

    - (void)setLicenseBuffer:(NSData *_Nonnull)licenseBuffer
               errorCallback:(nonnull MBLicenseErrorBlock)errorCallback;

    Swift

    func setLicenseBuffer(_ licenseBuffer: Data, errorCallback: @escaping MBLicenseErrorBlock)

    Parameters

    licenseBuffer

    Byte array containing the license.

    errorCallback

    A block that get executed when an issue with the license occurs. The only parameter represents the type of the issue.

  • Set license buffer and unlock the SDK. Also define licensee that will be used to validate the license. This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of single license within multiple application packages.

    Declaration

    Objective-C

    - (void)setLicenseBuffer:(NSData *_Nonnull)licenseBuffer
                 andLicensee:(NSString *_Nonnull)licensee
               errorCallback:(nonnull MBLicenseErrorBlock)errorCallback;

    Swift

    func setLicenseBuffer(_ licenseBuffer: Data, andLicensee licensee: String, errorCallback: @escaping MBLicenseErrorBlock)

    Parameters

    licenseBuffer

    Byte array containing the license.

    licensee

    Licensee to which license is given to.

    errorCallback

    A block that get executed when an issue with the license occurs. The only parameter represents the type of the issue.

  • Set license key and unlock the SDK. Application package will be used to validate the license.

    Declaration

    Objective-C

    - (void)setLicenseKey:(NSString *_Nonnull)base64LicenseKey
            errorCallback:(nonnull MBLicenseErrorBlock)errorCallback;

    Swift

    func setLicenseKey(_ base64LicenseKey: String, errorCallback: @escaping MBLicenseErrorBlock)

    Parameters

    base64LicenseKey

    License file encoded as base64 string.

    errorCallback

    A block that get executed when an issue with the license occurs. The only parameter represents the type of the issue.

  • Set license key and unlock the SDK. Also define licensee that will be used to validate the license. This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of single license within multiple application packages.

    Declaration

    Objective-C

    - (void)setLicenseKey:(NSString *_Nonnull)base64LicenseKey
              andLicensee:(NSString *_Nonnull)licensee
            errorCallback:(nonnull MBLicenseErrorBlock)errorCallback;

    Swift

    func setLicenseKey(_ base64LicenseKey: String, andLicensee licensee: String, errorCallback: @escaping MBLicenseErrorBlock)

    Parameters

    base64LicenseKey

    Byte array containing the license.

    licensee

    Licensee to which license is given to.

    errorCallback

    A block that get executed when an issue with the license occurs. The only parameter represents the type of the issue.

  • Set the license file and unlock the SDK. Application package will be used to validate the license.

    Declaration

    Objective-C

    - (void)setLicenseResource:(NSString *_Nonnull)fileName
                 withExtension:(NSString *_Nullable)extension
                inSubdirectory:(NSString *_Nullable)subdirectory
                     forBundle:(NSBundle *_Nonnull)bundle
                 errorCallback:(nonnull MBLicenseErrorBlock)errorCallback;

    Swift

    func setLicenseResource(_ fileName: String, withExtension extension: String?, inSubdirectory subdirectory: String?, for bundle: Bundle, errorCallback: @escaping MBLicenseErrorBlock)

    Parameters

    fileName

    The name of resource file contained in the directory specified by subdirectory. If you specify nil, the method returns the first resource file it finds with the specified extension in that directory.

    extension

    The filename extension of the file (etc. txt). If you specify an empty string or nil, the extension is assumed not to exist and the file URL is the first file encountered that exactly matches name.

    subdirectory

    The valid path of top-level directory in which file is located inside bundle (etc. licenseFiles/). If you specify an empty string or nil, root direcotry of bundle will be searched.

    bundle

    NSBundle bundle required to access file.

    errorCallback

    A block that get executed when an issue with the license occurs. The only parameter represents the type of the issue.

  • Set the license file and unlock the SDK. Also define licensee that will be used to validate the license. This method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK. Unlocking Microblink SDK in library mode allows usage of single license within multiple application packages.

    Declaration

    Objective-C

    - (void)setLicenseResource:(NSString *_Nonnull)fileName
                 withExtension:(NSString *_Nullable)extension
                inSubdirectory:(NSString *_Nullable)subdirectory
                     forBundle:(NSBundle *_Nonnull)bundle
                   andLicensee:(nonnull NSString *)licensee
                 errorCallback:(nonnull MBLicenseErrorBlock)errorCallback;

    Swift

    func setLicenseResource(_ fileName: String, withExtension extension: String?, inSubdirectory subdirectory: String?, for bundle: Bundle, andLicensee licensee: String, errorCallback: @escaping MBLicenseErrorBlock)

    Parameters

    fileName

    The name of resource file contained in the directory specified by subdirectory.

    extension

    The filename extension of the file (etc. txt). If you specify an empty string or nil, the extension is assumed not to exist and the file URL is the first file encountered that exactly matches name.

    subdirectory

    The valid path of top-level directory in which file is located inside bundle (etc. licenseFiles/). If you specify an empty string or nil, root direcotry of bundle will be searched.

    bundle

    NSBundle bundle required to access file.

    licensee

    Licensee to which license is given to.

    errorCallback

    A block that get executed when an issue with the license occurs. The only parameter represents the type of the issue.

  • Returns the string that contains the library build version

    Declaration

    Objective-C

    + (nonnull NSString *)buildVersionString;

    Swift

    class func buildVersionString() -> String

    Return Value

    string that contains the library build version

  • This method returns true when scanning is unsupported on a specific device. Error object contains description of the reason for that.

    Declaration

    Objective-C

    + (BOOL)isScanningUnsupportedForCameraType:(MBCameraType)type
                                         error:(NSError *_Nullable *_Nullable)error;

    Swift

    class func isScanningUnsupported(for type: MBCameraType, error: NSErrorPointer) -> Bool

    Parameters

    type

    The camera type you want to check for.

    error

    If scanning is not supported, when method this method returns, this parameter contains an NSError object that describes the problem. If you are not interested in possible errors, pass in NULL.

    Return Value

    YES if scanning is not supported, NO otherwise.