iOS SDK

Set up Evrotrust SDK

There are two options for environment:

  • EvrotrustEnvironmentTest
  • EvrotrustEnvironmentProd

Start process

- (void)evrotrustSetupSDKDidFinish:(EvrotrustSetupSDKResult *)result 
{ 
	switch (result.status) { 
		case EvrotrustResultStatusErrorInput: 
			break; 
		case EvrotrustResultStatusOK: { 
			BOOL SDKSetUp = result.isSetUp; 
			BOOL hasNewVersion = result.hasNewVersion; 
			BOOL isInMaintenance = result.isInMaintenance; 
			break; 
		} 
	} 
} 
Evrotrust.sdk().setupSDKWhitAppNumber(applicationNumber, environment: EvrotrustEnvironment.test, andDelegate: self)

Receive result

func evrotrustSetupSDKDidFinish(_ result: EvrotrustSetupSDKResult!) { 
	switch result.status { 
	case EvrotrustResultStatus.errorInput: 
		break 
	case EvrotrustResultStatus.OK: 
		let SDKSetUp = result.isSetUp 
		let hasNewVerstion = result.hasNewVersion 
		let isInMaintenance = result.isInMaintenance 
		break 
	default: 
		break 
	} 
} 
func evrotrustSetupSDKDidFinish(_ result: EvrotrustSetupSDKResult!) { 
	switch result.status { 
	case EvrotrustResultStatus.errorInput: 
		break 
	case EvrotrustResultStatus.OK: 
		let SDKSetUp = result.isSetUp 
		let hasNewVerstion = result.hasNewVersion 
		let isInMaintenance = result.isInMaintenance 
		break 
	default: 
		break 
	} 
} 

Check whether the SDK is set up

Start process

BOOL SDKSetUp = [[Evrotrust sdk] SDKSetup];
let SDKSetUp: Bool? = Evrotrust.sdk()?.sdkSetUp()

Setup device with Evrotrust profile

The parameter shouldSkipContactInformation can be used to skip the screens where the user adds contact information (phone and email) to his Evrotrust account.

The parameter userInformation is optional. It is used for precheck to determinate whether the user has Evrotrust profile or not. Country code is needed and used only if data type is EvrotrustUserTypeIdentificationNumber.

There are two parameters for country code, but only one has to be provided:

  • countryCode2 – for 2 letter code
  • countryCode3 – for 3 letter code

Start process

EvrotrustSetupViewController *viewController = [[Evrotrust sdk] createEvrotrustSetupViewController]; 
viewController.delegate = self; 
viewController.actingAsRegistrationAuthority = NO; // always has to be NO 
viewController.securityContext = @"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; // optional parameter 
viewConstroller.shouldSkipContactInformation = NO; // optional parameter 
EvrotrustUserInformation *userInformation = [[EvrotrustUserInformation alloc] init]; 
userInformation.userDataType = EvrotrustUserTypeIdentificationNumber; 
userInformation.userDataValue = @"7204141595"; 
userInformation.countryCode3 = @"BGR"; // country code by ISO 3166 
viewController.userInformationForCheck = userInformation; // optional parameter 
[self.navigationController pushViewController:viewController animated:YES];
let viewController: EvrotrustSetupViewController = (Evrotrust.sdk()?.createEvrotrustSetupViewController())! 
viewController.delegate = self 
viewController.isActingAsRegistrationAuthority = false // always has to be false 
viewController.securityContext = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" // optional parameter 
viewController.shouldSkipContactInformation = false  // optional parameter 
let userInformation: EvrotrustUserInformation = EvrotrustUserInformation() 
userInformation.userDataType = EvrotrustUserType.identificationNumber 
userInformation.userDataValue = "7204141595" 
userInformation.countryCode3 = "BGR"  // country code by ISO 3166 
viewController.userInformationForCheck = userInformation // optional parameter 
self.navigationController?.pushViewController(viewController, animated:true) 

Receive result

- (void)evrotrustSetupDidFinish:(EvrotrustSetupProfileResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserCanceled: 
            break; 
             
        case EvrotrustResultStatusOK: 
            if (result.userSetUp) { 
                NSString *securityContext = result.securityContext; 
                NSString *pinCode = result.pinCode; 
                NSString *personalIdentificationNumber = result.personalIdentificationNumber; 
                NSString *countryCode2 = result.countryCode2; // 2 letter country code by ISO 3166 
                NSString *countryCode3 = result.countryCode3; // 3 letter country code by ISO 3166 
                NSString *phone = result.phone; 
                NSString *firstName = result.firstName; 
                NSString *middleName = result.middleName; 
                NSString *lastName = result.lastName; 
                NSString *firstLatinName = result.firstLatinName; 
                NSString *middleLatinName = result.middleLatinName; 
                NSString *lastLatinName = result.lastLatinName; 
                BOOL isIdentified = result.identified; 
                BOOL isSupervised = result.supervised; 
                BOOL isReadyToSign = result.readyToSign; 
                BOOL isRejected = result.rejected; 
                EvrotrustIdentificationRejectReason rejectReason = result.rejectReason; 
 
            } 
            break; 
    } 
} 
func evrotrustSetupDidFinish(_ result: EvrotrustSetupProfileResult!) { 
    switch result.status { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.errorInput: 
        break 
    case EvrotrustResultStatus.userCanceled: 
 				break; 
    case EvrotrustResultStatus.OK: 
        if result.userSetUp { 
            let securityContext: String = result.securityContext 
            let pinCode: String = result.pinCode 
            let personalIdentificationNumber: String = result.personalIdentificationNumber 
            let countryCode2: String = result.countryCode2 // 2 letter country code by ISO 3166 
            let countryCode3: String = result.countryCode3 // 3 letter country code by ISO 3166 
            let phone: String = result.phone 
            let fisrtName: String = result.firstName 
            let middleName: String = result.middleName 
            let lastName: String = result.lastName 
            let firstLatinName: String = result.firstLatinName 
            let middleLatinName: String = result.middleLatinName 
            let lastLatinName: String = result.lastLatinName 
            let isIdentified: Bool = result.identified 
            let isSupervised: Bool = result.supervised 
            let isReadyToSign: Bool = result.readyToSign 
            let isRejected: Bool = result.rejected 
            let rejectReason: EvrotrustIdentificationRejectReason = result.rejectReason 
        } 
        break 
    default: 
        break 
    } 
}

If new profile has to be created the user will be automatically identified. The partner is acting as registration authority for Evrotrust.

The parameter shouldSkipContactInformation can be used to skip the screens where the user adds contact information (phone and email) to his Evrotrust account. This screens are opened only if the provided phone and email cannot be automatically added to the user account.

There are two parameters for country code, but only one has to be provided:

  • countryCode2 – for 2 letter code
  • countryCode3 – for 3 letter code

Start process

EvrotrustSetupViewController *viewController = [[Evrotrust sdk] createEvrotrustSetupViewController]; 
viewController.delegate = self; 
viewController.actingAsRegistrationAuthority = YES; // always has to be YES 
viewController.securityContext = @"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; 
viewController.identificationTransactionID = @"123456789012"; 
viewController.personalIdentificationNumber = @"7204141595"; // required for countries that have identification number 
viewController.countryCode3 = @"BGR"; // country code by ISO 3166 
viewController.documentType = EvrotrustDocumentTypeID; 
viewController.documentNumber = @"636417733"; 
viewController.phoneNumber = @"+359888778877"; 
viewController.emailAddress = @"[email protected]";    // optional parameter 
viewConstroller.shouldSkipContactInformation = NO; // optional parameter 
[self.navigationController pushViewController:viewController animated:YES]; 
let viewController: EvrotrustSetupViewController = (Evrotrust.sdk()?.createEvrotrustSetupViewController())! 
viewController.delegate = self 
viewController.isActingAsRegistrationAuthority = true // always has to be true 
viewController.securityContext = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" 
viewController.identificationTransactionID = "123456789012" 
viewController.personalIdentificationNumber = "7204141595" // required for countries that have identification number 
viewController.countryCode3 = "BGR" // country code by ISO 3166 
viewController.documentType = EvrotrustDocumentType.ID 
viewController.documentNumber = "636417733" 
viewController.phoneNumber = "+359888778877" 
viewController.emailAddress = "[email protected]" // optional parameter 
viewController.shouldSkipContactInformation = false // optional parameter 
self.navigationController?.pushViewController(viewController, animated:true) 

Receive result

- (void)evrotrustSetupDidFinish:(EvrotrustSetupProfileResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusUserNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserCanceled: 
            break; 
             
        case EvrotrustResultStatusOK: 
            if (result.userSetUp) { 
                NSString *securityContext = result.securityContext; 
                NSString *personalIdentificationNumber = result.personalIdentificationNumber; 
                NSString *countryCode2 = result.countryCode2; // 2 letter country code by ISO 3166 
                NSString *countryCode3 = result.countryCode3; // 3 letter country code by ISO 3166 
                NSString *phone = result.phone; 
                NSString *firstName = result.firstName; 
                NSString *middleName = result.middleName; 
                NSString *lastName = result.lastName; 
                NSString *firstLatinName = result.firstLatinName; 
                NSString *middleLatinName = result.middleLatinName; 
                NSString *lastLatinName = result.lastLatinName; 
                BOOL identified = result.identified; 
                BOOL supervised = result.supervised; 
                BOOL readyToSign = result.readyToSign; 
                BOOL rejected = result.rejected; 
                EvrotrustIdentificationRejectReason rejectReason = result.rejectReason; 
 
            } 
            break; 
    } 
} 
func evrotrustSetupDidFinish(_ result: EvrotrustSetupProfileResult!) { 
    switch result.status { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.errorInput: 
        break; 
    case EvrotrustResultStatus.userCanceled: 
        break; 
    case EvrotrustResultStatus.OK: 
        if result.userSetUp { 
            let securityContext: String = result.securityContext; 
            let personalIdentificationNumber: String = result.personalIdentificationNumber; 
            let countryCode2: String = result.countryCode2 // 2 letter country code by ISO 3166 
            let countryCode3: String = result.countryCode3 // 3 letter country code by ISO 3166 
            let phone: String = result.phone 
            let firstName: String = result.firstName 
            let middleName: String = result.middleName 
            let lastName: String = result.lastName 
            let firstLatinName: String = result.firstLatinName 
            let middleLatinName: String = result.middleLatinName 
            let lastLatinName: String = result.lastLatinName 
            let identified: Bool = result.identified 
            let supervised: Bool = result.supervised 
            let readyToSign: Bool = result.readyToSign 
            let rejected: Bool = result.rejected 
            let rejectReason: EvrotrustIdentificationRejectReason = result.rejectReason 
        } 
        break 
    default: 
        break 
    } 
} 

Check for user status

Start process

[[Evrotrust sdk] checkUserStatusWithDelegate:self];
Evrotrust.sdk()?.checkUserStatus(with: self)

Receive result

- (void)evrotrustCheckUserStatusDelegateDidFinish:(EvrotrustCheckUserStatusResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusUserNotSetUp: 
        break;             
        case EvrotrustResultStatusOK: { 
            BOOL successfulCheck = result.successfulCheck; 
            if (successfulCheck) { 
                BOOL identified = result.identified; 
                BOOL supervised = result.supervised; 
                BOOL readyToSign = result.readyToSign; 
                BOOL rejected = result.rejected; 
                BOOL confirmedPhone = result.confirmedPhone; 
                BOOL confirmedEmail = result.confirmedEmail; 
                EvrotrustIdentificationRejectReason rejectReason = result.rejectReason; 
            } 
            break; 
    } 
}
func evrotrustCheckUserStatusDelegateDidFinish(_ result: EvrotrustCheckUserStatusResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.userNotSetUp: 
        break 
    case EvrotrustResultStatus.OK: 
        let successfulCheck: Bool = result.successfulCheck 
        if (successfulCheck) { 
            let identified: Bool = result.identified 
            let supervised: Bool = result.supervised 
            let readyToSign: Bool = result.readyToSign 
            let rejected: Bool = result.rejected 
            let confirmedPhone: Bool = result.confirmedPhone 
            let confirmedEmail: Bool = result.confirmedEmail 
            let rejectReason: EvrotrustIdentificationRejectReason = result.rejectReason 
        } 
        break 
    default: 
        break 
    } 
}

Subscribe for user status changes

It is possible only if the identification or supervising of the user is in progress. The result will be sent via request /user/identification/status of the Vendor callback API.

Start process

[[Evrotrust sdk] subscribeForUserStatusCallback:@"htpps://example.com" withSecurityContext:@"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" andDelegate:self]; 
Evrotrust.sdk()?.subscribe(forUserStatusCallback: "htpps://example.com", withSecurityContext: "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92", andDelegate: self) 

Receive result

- (void)evrotrustSubscribeForUserStatusCallbackDelegateDidFinish:(EvrotrustSubscribeForUserStatusCallbackResult 
*)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserNotSetUp: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            BOOL successful = result.successful; 
            if (successful) { 
                BOOL subscribed = result.subscribed; 
                BOOL identified = result.identified; 
                BOOL supervised = result.supervised; 
                BOOL readyToSign = result.readyToSign; 
                BOOL rejected = result.rejected; 
                EvrotrustIdentificationRejectReason rejectReason = result.rejectReason; 
            } 
            break; 
        } 
    } 
} 
func evrotrustSubscribe(forUserStatusCallbackDelegateDidFinish result: EvrotrustSubscribeForUserStatusCallbackResult!) 
{ 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.errorInput: 
        break 
    case EvrotrustResultStatus.userNotSetUp: 
        break 
    case EvrotrustResultStatus.OK: 
        let successful: Bool = result.successful 
        if (successful) { 
            let subscribed: Bool = result.subscribed 
            let identified: Bool = result.identified 
            let supervised: Bool = result.supervised 
            let readyToSign: Bool = result.readyToSign 
            let rejected: Bool = result.rejected 
            let rejectReason: EvrotrustIdentificationRejectReason = result.rejectReason 
        } 
        break 
    default: 
        break 
    } 
}

Edit user profile

Start process

EvrotrustEditAndIdentifyViewController *viewController=[[Evrotrust sdk] createEvrotrustEditAndIdentifyViewController]; 
viewController.editPersonalDataDelegate = self; 
viewController.securityContext = @"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; 
[self.navigationController pushViewController:viewController animated:YES]; 
let viewController: EvrotrustEditAndIdentifyViewController = (Evrotrust.sdk()?.createEvrotrustEditAndIdentifyViewController())! 
viewController.editPersonalDataDelegate = self 
viewController.securityContext = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" 
self.navigationController?.pushViewController(viewController, animated:true)

Receive result

- (void)evrotrustEditPersonalDataDidFinish:(EvrotrustEditPersonalDataResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserNotSetUp: 
            break; 
             
        case EvrotrustResultStatusUserCanceled: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            BOOL editPersonalData = result.editPersonalData; 
            if (editPersonalData) { 
                BOOL identified = result.identified; 
                BOOL supervised = result.supervised; 
                BOOL readyToSign = result.readyToSign; 
                BOOL rejected = result.rejected; 
                EvrotrustIdentificationRejectReason rejectReason = result.rejectReason; 
            } 
            break; 
        } 
    } 
} 
func evrotrustEditPersonalDataDidFinish(_ result: EvrotrustEditPersonalDataResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.errorInput: 
        break 
    case EvrotrustResultStatus.userNotSetUp: 
        break 
    case EvrotrustResultStatus.userCanceled: 
        break 
    case EvrotrustResultStatus.OK: 
        let editPersonalData: Bool = result.editPersonalData 
        if (editPersonalData) { 
            let identified: Bool = result.identified 
            let supervised: Bool = result.supervised 
            let readyToSign: Bool = result.readyToSign 
            let rejected: Bool = result.rejected 
            let rejectReason: EvrotrustIdentificationRejectReason = result.rejectReason 
        } 
        break; 
    } 
}

Open group of documents

Start process

EvrotrustOpenDocumentViewController *viewController = [[Evrotrust sdk] createEvrotrustOpenDocumentViewController]; 
viewController.delegate = self; 
viewController.securityContext = @"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; 
viewController.transactionID = @"123456789012"; 
viewController.singleDocument = NO; 
[self.navigationController pushViewController:viewController animated:YES];
let viewController: EvrotrustOpenDocumentViewController = 
(Evrotrust.sdk()?.createEvrotrustOpenDocumentViewController())! 
viewController.delegate = self 
viewController.securityContext = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" 
viewController.transactionID = "123456789012" 
viewController.isSingleDocument = false 
self.navigationController?.pushViewController(viewController, animated:true)

Receive result

- (void)evrotrustOpenGroupDocumentsDidFinish:(EvrotrustOpenDocumentResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserCanceled: 
            break; 
             
        case EvrotrustResultStatusUserNotSetUp: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            EvrotrustUserDecision userDecision = result.userDecision; // Approved, Rejected, No Choice 
            break; 
        } 
    } 
}
func evrotrustOpenGroupDocumentsDidFinish(_ result: EvrotrustOpenDocumentResult!) { 
        switch (result.status) { 
        case EvrotrustResultStatus.sdkNotSetUp: 
            break 
        case EvrotrustResultStatus.errorInput: 
            break 
        case EvrotrustResultStatus.userCanceled: 
            break 
        case EvrotrustResultStatus.userNotSetUp: 
            break 
        case EvrotrustResultStatus.OK: 
            let userDecision: EvrotrustUserDecision = result.userDecision // Approved, Rejected, No Choice 
            break 
        default: 
            break 
        } 
    } 

Open single document

Start process

EvrotrustOpenDocumentViewController *viewController = [[Evrotrust sdk] createEvrotrustOpenDocumentViewController]; 
viewController.delegate = self; 
viewController.securityContext = @"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; 
viewController.transactionID = @"123456789012"; 
viewController.singleDocument = YES; 
[self.navigationController pushViewController:viewController animated:YES]; 
let viewController: EvrotrustOpenDocumentViewController = 
(Evrotrust.sdk()?.createEvrotrustOpenDocumentViewController())! 
viewController.delegate = self 
viewController.securityContext = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" 
viewController.transactionID = "123456789012" 
viewController.isSingleDocument = true 
self.navigationController?.pushViewController(viewController, animated: true)

Receive result

- (void)evrotrustOpenSingleDocumentDidFinish:(EvrotrustOpenDocumentResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserCanceled: 
            break; 
             
        case EvrotrustResultStatusUserNotSetUp: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            EvrotrustUserDecision userDecision = result.userDecision; // Approved, Rejected, No Choice 
            break; 
        } 
    } 
} 
func evrotrustOpenSingleDocumentDidFinish(_ result: EvrotrustOpenDocumentResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.errorInput: 
        break 
    case EvrotrustResultStatus.userCanceled: 
        break 
    case EvrotrustResultStatus.userNotSetUp: 
        break 
    case EvrotrustResultStatus.OK: 
        let userDecision: EvrotrustUserDecision = result.userDecision // Approved, Rejected, No Choice 
        break 
    default: 
       break 
    } 
} 

Check for user set up on the device

Start process

[[Evrotrust sdk] userSetUpWithDelegate:self];
Evrotrust.sdk()?.userSetUp(with: self)

Receive result

- (void)evrotrustUserSetUpDelegateDidFinish:(EvrotrustUserSetUpResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            BOOL userSetUp = result.userSetUp; 
            break; 
    } 
} 
func evrotrustUserSetUpDelegateDidFinish(_ result: EvrotrustUserSetUpResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.OK: 
        let userSetUp: Bool = result.userSetUp; 
        break 
    default: 
        break 
    } 
}

Check for user set up online

Start process

[[Evrotrust sdk] userSetUpOnlineWithDelegate:self]; 
Evrotrust.sdk()?.userSetUpOnline(with: self)

Receive result

- (void)evrotrustUserSetUpOnlineDelegateDidFinish:(EvrotrustUserSetUpOnlineResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            BOOL successfulCheck = result.successfulCheck; 
            if (successfulCheck) { 
                BOOL userSetUp = result.userSetUp; 
            } 
            break; 
    } 
} 
func evrotrustUserSetUpOnlineDelegateDidFinish(_ result: EvrotrustUserSetUpOnlineResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.OK: 
        let successfulCheck: Bool = result.successfulCheck; 
        if (successfulCheck) { 
            let userSetUp: Bool = result.userSetUp; 
        } 
        break 
    default: 
        break 
    } 
} 

Change language of the SDK

[[Evrotrust sdk] setLanguage:@"en"]; // available params "en", "bg", "de", "hu", "sq", "mk", "fr", "it", "ro",  default is "en" 
Evrotrust.sdk()?.setLanguage("en") // available params "en", "bg", "de", "hu", "sq", "mk", "fr", "it", "ro", default is "en"

Change the security context of the user

Start process

[[Evrotrust sdk] changeSecurityContext:securityContext withNewSecurityContext:newSecurityContext andDelegate:self];
Evrotrust.sdk()?.changeSecurityContext(securityContext, withNewSecurityContext: newSecurityContext, andDelegate: self)

Receive result

- (void)evrotrustChangeSecurityContextDelegateDidFinish:(EvrotrustChangeSecurityContextResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserNotSetUp: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            BOOL changed = result.changed; 
            break; 
        } 
    } 
} 
func evrotrustChangeSecurityContextDelegateDidFinish(_ result: EvrotrustChangeSecurityContextResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break; 
    case EvrotrustResultStatus.errorInput: 
        break; 
    case EvrotrustResultStatus.userNotSetUp: 
        break; 
    case EvrotrustResultStatus.OK: 
        let changed: Bool = result.changed 
        break 
    default: 
        break 
    } 
} 

Open settings screens

This method returns result only if the SDK is not set up.

EvrotrustSettingsViewController *viewController = [[Evrotrust sdk] createEvrotrustSettingsViewController]; viewController.securityContext = @"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"; [self.navigationController pushViewController:viewController animated:YES];
let viewController: EvrotrustSettingsViewController = (Evrotrust.sdk()?.createEvrotrustSettingsViewController())! 
viewController.securityContext = "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92" 
self.navigationController?.pushViewController(viewController, animated: true)

Receive result

- (void)evrotrustSettingsDidFinish:(EvrotrustSettingsResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
        } 
    } 
} 
func evrotrustSettingsDidFinish(_ result: EvrotrustResult!) { 
    switch (result.status) { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    default: 
        break 
    } 
} 

Identity verification process

This process verifies the identity of the user and returns its data like names, personal identification number, ID/Passport document number etc. Evrotrust account will not be created.

If parameter personalIdentificationNumber is sent, the personal identification number from the scanned document will be compared to it.

If parameter documentType is sent, the document type from the scanned document will be compared to it.

If parameter countryCode2 or countryCode3 is sent, the issuing country of the scanned document will be compared to it.

There are two parameters for country code, but only one has to be provided:

  • countryCode2 – for 2 letter code
  • countryCode3 – for 3 letter code

Parameters return* specify which user data to be returned at the end of the process. If all of them are false, all data will be returned

The user pictures and video can be requested via returnPictures and received using Evrotrust Vendor API.

Start process

EvrotrustOnetimeIdentificationViewController *viewController = [[Evrotrust sdk] 
createEvrotrustOnetimeIdentificationViewController]; 
viewController.delegate = self; 
viewController.vendorNumber = @"1a2b3c4d5e6f"; // The vendor number is provided by Evrotrust 
viewController.externalReferenceID = @"abc-123-def-456"; // String parameter, provided by the vendor and returned at 
the end. Max length 32. 
viewController.scenario = EvrotrustOnetimeIdentificationScenarioBasic; // Possible values: Basic and Enhanced 
viewController.urlCallback = @"https://example-endpoint.com"; // It is used only for Enhanced scenario 
viewController.personalIdentificationNumber = @"7204141595"; // optional 
viewController.documentType = EvrotrustDocumentTypeID; // optional 
viewController.countryCode3 = @"BGR"; // optional, country code by ISO 3166 
viewController.returnNames = YES; 
viewController.returnLatinNames = YES; 
viewController.returnIdentificationNumber = YES; 
viewController.returnDocumentNumber = YES; 
viewController.returnDocumentType = YES; 
viewController.returnDocumentCountry = YES; 
viewController.returnDocumentValidDate = YES; 
viewController.returnDocumentIssueDate = YES; 
viewController.returnDocumentIssuerName = YES; 
viewController.returnDateOfBirth = YES; 
viewController.returnPlaceOfBirth = YES; 
viewController.returnAddress = YES; 
viewController.returnNationality = YES; 
viewController.returnSex = YES; 
viewController.returnPictures = YES; 
[self.navigationController pushViewController:viewController animated:YES]; 
let viewController: EvrotrustOnetimeIdentificationViewController = 
(Evrotrust.sdk()?.createEvrotrustOnetimeIdentificationViewController())! 
viewController.delegate = self 
viewController.vendorNumber = "1a2b3c4d5e6f" // The vendor number is provided by Evrotrust 
viewController.externalReferenceID = "abc-123-def-456" // String parameter, provided by the vendor and returned at the 
end. Max length 32. 
viewController.scenario = EvrotrustOnetimeIdentificationScenario.basic // Possible values: Basic and Enhanced 
viewController.urlCallback = "https://example-endpoint.com" // It is used only for Enhanced scenario 
viewController.personalIdentificationNumber = "7204141595" // optional 
viewController.documentType = EvrotrustDocumentType.ID // optional 
viewController.countryCode3 = "BGR" // optional, country code by ISO 3166 
viewController.returnNames = true 
viewController.returnLatinNames = true 
viewController.returnIdentificationNumber = true 
viewController.returnDocumentNumber = true 
viewController.returnDocumentType = true 
viewController.returnDocumentCountry = true 
viewController.returnDocumentValidDate = true 
viewController.returnDocumentIssueDate = true 
viewController.returnDocumentIssuerName = true 
viewController.returnDateOfBirth = true 
viewController.returnPlaceOfBirth = true 
viewController.returnAddress = true 
viewController.returnNationality = true 
viewController.returnSex = true 
viewController.returnPictures = true 
self.navigationController?.pushViewController(viewController, animated:true) 

Receive result

- (void)evrotrustOnetimeIdentificationDidFinish:(EvrotrustOnetimeIdentificationResult *)result 
{ 
    switch (result.status) { 
        case EvrotrustResultStatusSDKNotSetUp: 
            break; 
             
        case EvrotrustResultStatusErrorInput: 
            break; 
             
        case EvrotrustResultStatusUserCanceled: 
            break; 
             
        case EvrotrustResultStatusOK: { 
            NSString *externalReferenceID = result.externalReferenceID; 
            NSString *referenceID = result.referenceID; 
            CGFloat personPresence = result.personPresence; 
            EvrotrustFaceScanResult liveness = result.liveness; 
            EvrotrustFaceScanResult faceMatch = result.faceMatch; 
            if (result.onetimeIdentificationStatus == EvrotrustOnetimeIdentificationStatusSuccess) { 
                NSString *firstName = result.firstName; 
                NSString *middleName = result.middleName; 
                NSString *lastName = result.lastName; 
                NSString *firstNameLatin = result.firstNameLatin; 
                NSString *middleNameLatin = result.middleNameLatin; 
                NSString *lastNameLatin = result.lastNameLatin; 
                NSString *identificationNumber = result.identificationNumber; 
                NSString *documentNumber = result.documentNumber; 
                EvrotrustDocumentType documentType = result.documentType; 
                NSString *documentCountryCode2 = result.documentCountryCode2; // 2 letter country code by ISO 3166 
                NSString *documentCountryCode3 = result.documentCountryCode3; // 3 letter country code by ISO 3166 
                NSTimeInterval documentValidDate = result.documentValidDate; 
                NSTimeInterval documentIssueDate = result.documentIssueDate; 
                NSString *documentIssuerName = result.documentIssuerName; 
                NSTimeInterval dateOfBirth = result.dateOfBirth; 
                NSString *placeOfBirth = result.placeOfBirth; 
                NSString *address = result.address; 
                NSString *district = result.district; 
                NSString *municipality = result.municipality; 
                NSString *settlement = result.settlement; 
                NSString *location = result.location; 
                NSString *buildingNumber = result.buildingNumber; 
                NSString *entrance = result.entrance; 
                NSString *floor = result.floor; 
                NSString *apartment = result.apartment; 
                NSString *nationality = result.nationality; 
                NSString *nationalityCode = result.nationalityCode; 
                EvrotrustSexType sex = result.sex; 
                EvrotrustSourceUserData firstNameSource = result.firstNameSource; 
                EvrotrustSourceUserData middleNameSource = result.middleNameSource; 
                EvrotrustSourceUserData lastNameSource = result.lastNameSource; 
                EvrotrustSourceUserData firstNameLatinSource = result.firstNameLatinSource; 
                EvrotrustSourceUserData middleNameLatinSource = result.middleNameLatinSource; 
                EvrotrustSourceUserData lastNameLatinSource = result.lastNameLatinSource; 
                EvrotrustSourceUserData identificationNumberSource = result.identificationNumberSource; 
                EvrotrustSourceUserData documentNumberSource = result.documentNumberSource; 
                EvrotrustSourceUserData documentTypeSource = result.documentTypeSource; 
                EvrotrustSourceUserData documentCountryCodeSource = result.documentCountryCodeSource; 
                EvrotrustSourceUserData documentValidDateSource = result.documentValidDateSource; 
                EvrotrustSourceUserData documentIssueDateSource = result.documentIssueDateSource; 
                EvrotrustSourceUserData documentIssuerNameSource = result.documentIssuerNameSource; 
                EvrotrustSourceUserData dateOfBirthSource = result.dateOfBirthSource; 
                EvrotrustSourceUserData placeOfBirthSource = result.placeOfBirthSource; 
                EvrotrustSourceUserData addressSource = result.addressSource; 
                EvrotrustSourceUserData nationalitySource = result.nationalitySource; 
                EvrotrustSourceUserData sexSource = result.sexSource; 
            } else if (result.onetimeIdentificationStatus == EvrotrustOnetimeIdentificationStatusUnsuccess) { 
                EvrotrustOnetimeIdentificationUnsuccessReason reason = result.unsuccessReason; 
            } else { // EvrotrustOnetimeIdentificationStatusWaitingSupervising 
                // The result will be sent via request /onetimeidentification/status of the Vendor callback API. 
            } 
            break; 
        } 
    } 
} 
func evrotrustOnetimeIdentificationDidFinish(_ result: EvrotrustOnetimeIdentificationResult!) { 
    switch result.status { 
    case EvrotrustResultStatus.sdkNotSetUp: 
        break 
    case EvrotrustResultStatus.errorInput: 
        break 
    case EvrotrustResultStatus.userCanceled: 
        break; 
    case EvrotrustResultStatus.OK: 
        let externalReferenceID: String = result.externalReferenceID; 
        let referenceID: String = result.referenceID; 
        let personPresence: CGFloat = result.personPresence; 
        let liveness: EvrotrustFaceScanResult = result.liveness; 
        let faceMatch: EvrotrustFaceScanResult = result.faceMatch; 
        if (result.onetimeIdentificationStatus == EvrotrustOnetimeIdentificationStatus.success) { 
            let firstName: String = result.firstName 
            let middleName: String = result.middleName 
            let lastName: String = result.lastName 
            let firstNameLatin: String = result.firstNameLatin 
            let middleNameLatin: String = result.middleNameLatin 
            let lastNameLatin: String = result.lastNameLatin 
            let identificationNumber: String = result.identificationNumber 
            let documentNumber: String = result.documentNumber 
            let documentType: EvrotrustDocumentType = result.documentType 
            let documentCountryCode2: String = result.documentCountryCode2 // 2 letter country code by ISO 3166 
            let documentCountryCode3: String = result.documentCountryCode3 // 3 letter country code by ISO 3166 
            let documentValidDate: TimeInterval = result.documentValidDate 
            let documentIssueDate: TimeInterval = result.documentIssueDate 
            let documentIssuerName: String = result.documentIssuerName 
            let dateOfBirth: TimeInterval = result.dateOfBirth 
            let placeOfBirth: String = result.placeOfBirth 
            let address: String = result.address 
            let district: String = result.district 
            let municipality: String = result.municipality 
            let settlement: String = result.settlement 
            let location: String = result.location 
            let buildingNumber: String = result.buildingNumber 
            let entrance: String = result.entrance 
            let floor: String = result.floor 
            let apartment: String = result.apartment 
            let nationality: String = result.nationality 
            let nationalityCode: String = result.nationalityCode 
            let sex: EvrotrustSexType = result.sex 
            let firstNameSource: EvrotrustSourceUserData = result.firstNameSource 
            let middleNameSource: EvrotrustSourceUserData = result.middleNameSource 
            let lastNameSource: EvrotrustSourceUserData = result.lastNameSource 
            let firstNameLatinSource: EvrotrustSourceUserData = result.firstNameLatinSource 
            let middleNameLatinSource: EvrotrustSourceUserData = result.middleNameLatinSource 
            let lastNameLatinSource: EvrotrustSourceUserData = result.lastNameLatinSource 
            let identificationNumberSource: EvrotrustSourceUserData = result.identificationNumberSource 
            let documentNumberSource: EvrotrustSourceUserData = result.documentNumberSource 
            let documentTypeSource: EvrotrustSourceUserData = result.documentTypeSource 
            let documentCountryCodeSource: EvrotrustSourceUserData = result.documentCountryCodeSource 
            let documentValidDateSource: EvrotrustSourceUserData = result.documentValidDateSource 
            let documentIssueDateSource: EvrotrustSourceUserData = result.documentIssueDateSource 
            let documentIssuerNameSource: EvrotrustSourceUserData = result.documentIssuerNameSource 
            let dateOfBirthSource: EvrotrustSourceUserData = result.dateOfBirthSource 
            let placeOfBirthSource: EvrotrustSourceUserData = result.placefBirthSource 
            let addressSource: EvrotrustSourceUserData = result.addressSource 
            let nationalitySource: EvrotrustSourceUserData = result.nationalitySource 
            let sexSource: EvrotrustSourceUserData = result.sexSource 
        } else if (result.onetimeIdentificationStatus == EvrotrustOnetimeIdentificationStatus.unsuccess) { 
            let reason: EvrotrustOnetimeIdentificationUnsuccessReason = result.unsuccessReason 
        } else { // WaitingSupervising 
            // The result will be sent via request /onetimeidentification/status of the Vendor callback API. 
        } 
        break 
    default: 
        break 
    } 
} 

UI customizations

Evrotrust SDK allows the developers to customize the UI by setting different colors, images and main font. Every parameter in the customization is optional and if not set the default value for that parameter will be used.

  • mainColor1 is used mainly on button backgrounds and navigation bar.
  • mainColor2 is used mainly on button titles and icons.
  • mainColor3 is used mainly on title labels.
  • backgroundColor1 is the main background color of the screens.
  • backgroundColor2 is used for background color of TextField controls.
  • backgroundColor3 is used for background color of the screens where there is TableView.
  • hintTextColor is used on TextField’s hint labels.
  • textColor1 is used mainly for the text color in all text fields and most of the labels.
  • textColor2 is used for button titles and labels where the background is mainColor1.
  • The images are used in the corresponding screens. The recommended size for scanInstructionsImage is 350x273 and for the other images is 100x100. These sizes are for mdpi / 1x.
  • whiteEvrotrustLogo determines the color of the Evrotrust logo. Set YES/true for white and NO/false for black.
  • The main font of the Evrotrust SDK can be change by providing the font name, file name of the font and the extension of the file.
EvrotrustCustomization *customization = [[EvrotrustCustomization alloc] init]; 
customization.mainColor1 = [UIColor redColor]; 
customization.mainColor2 = [UIColor redColor]; 
customization.mainColor3 = [UIColor redColor]; 
customization.backgroundColor1 = [UIColor whiteColor]; 
customization.backgroundColor2 = [UIColor whiteColor]; 
customization.backgroundColor3 = [UIColor whiteColor]; 
customization.textColor1 = [UIColor blackColor]; 
customization.textColor2 = [UIColor whiteColor]; 
customization.hintTextColor = [UIColor whiteColor]; 
customization.imageCustomizations.contactsTitleImage = [UIImage imageNamed:@"image_name"]; 
customization.imageCustomizations.documentsTitleImage = [UIImage imageNamed:@"image_name"]; 
customization.imageCustomizations.scanInstructionsImage = [UIImage imageNamed:@"image_name"]; 
customization.imageCustomizations.whiteEvrotrustLogo = YES; 
[customization setCustomFont:@"FontName" withFileName:@"font_file" andFileExtension:@"otf"]; 
[[Evrotrust sdk] setCustomization:customization]; 
let customization: EvrotrustCustomization = EvrotrustCustomization() 
customization.mainColor1 = UIColor.red 
customization.mainColor2 = UIColor.red 
customization.mainColor3 = UIColor.red 
customization.backgroundColor1 = UIColor.white 
customization.backgroundColor2 = UIColor.white 
customization.backgroundColor3 = UIColor.white 
customization.textColor1 = UIColor.black 
customization.textColor2 = UIColor.white 
customization.hintTextColor = UIColor.white 
customization.imageCustomizations.contactsTitleImage = UIImage(named: "image_name")! 
customization.imageCustomizations.documentsTitleImage = UIImage(named: "image_name")! 
customization.imageCustomizations.scanInstructionsImage = UIImage(named: "image_name")! 
customization.imageCustomizations.whiteEvrotrustLogo = true 
customization.setCustomFont("FontName", withFileName: "font_file", andFileExtension: "otf") 
Evrotrust.sdk()?.setCustomization(customization)

Change localizations

Evrotrust SDK supports the following languages – English, Bulgarian, German, Hungarian, Albanian, Macedonian, French, Italian and Romanian. Each package of the SDK comes with a folder “Localizations” in which the localization files are located. If some of the default localizations need to be changed, the appropriate localization file has to be added to the project as a localized file. After that any of the texts could be changed. The name of the file must be “Evrotrust.strings” otherwise it won’t be read by the SDK and the default localizations will be used.