//
//  StartViewController.m
//  MyIdSample

#import "StartViewController.h"
@import MyIdSDK;

@interface StartViewController ()<MyIdClientDelegate>

@end

@implementation StartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (IBAction)startMyId {
    MyIdOrganizationDetails *organizationDetails = [[MyIdOrganizationDetails alloc] init];
    organizationDetails.phoneNumber = @"4242";

    MyIdAppearance *appearance = [[MyIdAppearance alloc] init];
    appearance.primaryColor = [UIColor systemBlueColor];

    MyIdConfig *config = [[MyIdConfig alloc] init];
    config.clientId = @"";
    config.passportData = @"";
    config.dateOfBirth = @"";
    config.externalId = @"";
    config.buildMode = MyIdBuildModePRODUCTION;
    config.entryType = MyIdEntryTypeAUTH;
    config.residency = MyIdResidencyRESIDENT;
    config.locale = MyIdLocaleUZ;
    config.cameraShape = MyIdCameraShapeCIRCLE;
    config.organizationDetails = organizationDetails;
    config.appearance = appearance;
    config.withPhoto = false;

    [MyIdClient startWithConfig:config withDelegate:self];
}

#pragma mark MyIdClientDelegate

- (void)onSuccessWithResult:(MyIdResult *)result {
    NSLog(@"%@", result.code);
    NSLog(@"%@", result.comparisonValue);
    NSLog(@"%@", result.image);
}

- (void)onErrorWithException:(MyIdException *)exception {
    NSLog(@"%@", exception.code);
    NSLog(@"%@", exception.message);
}

- (void)onUserExited {
    NSLog(@"user exited");
}

@end
