//
//  VFYLicense.m
//
//  Created by MTN on 27/03/21.
//

#import "VFYLicense.h"
#import <MicroBlink/MicroBlink.h>

@implementation VFYLicense

/**
   Set the Id license key
*/
+ (void)setLicense:(NSDictionary*) jsonLicense {
    [MBMicroblinkSDK sharedInstance].showTrialLicenseWarning = false;
    NSString* iosLicense = [jsonLicense objectForKey:@"ios"]; //licenseKey
    NSLog(@"License KEY :: %@", iosLicense);
    if(iosLicense != nil){
        [[MBMicroblinkSDK sharedInstance] setLicenseKey:iosLicense errorCallback:^(MBLicenseError licenseError) {
            switch (licenseError) {
                case MBLicenseErrorInvalidLicense:
                    NSLog(@"Card error invalid license");
                    break;
                case MBLicenseErrorNetworkRequired:
                    NSLog(@"Card error network required");
                    break;
                case MBLicenseErrorUnableToDoRemoteLicenceCheck:
                    NSLog(@"Card error unable to do remote license check");
                    break;
                case MBLicenseErrorLicenseIsLocked:
                    NSLog(@"Card error License is locked");
                    break;
                case MBLicenseErrorLicenseCheckFailed:
                    NSLog(@"Card error License check failed");
                    break;
                default:
                    break;
            }
        }];
    }
}

@end
