onfido-ios-sdk icon indicating copy to clipboard operation
onfido-ios-sdk copied to clipboard

Document Issuing Country always requested, even if already provided

Open lmmenge opened this issue 2 years ago • 3 comments

What was the expected behaviour?

  • Configure the Onfido SDK for a session
  • Use a document which allows providing an issuing country (Identity card, Driver's license)
  • If a document type and country is specified, Onfido should not ask the user for the issuing country again.

What happened instead?

  • The Onfido SDK request issuing country right at the start of the flow

Simulator Screen Shot - iPhone SE (1st generation) - 2022-06-23 at 09 33 56

Version info:

  • Cocoapods (if applicable): No Cocoapods. XCFramework used.
  • Onfido SDK (Debug/Release): 25.1.0 (Release)
  • iOS: 15.5
  • Xcode: 13.4
  • Device/Simulator: Simulator
  • Device/Simulator language: English/USA

Integration configuration:

	ONFlowConfigBuilder* configBuilder = [ONFlowConfig builder];
	[configBuilder withSdkToken:@"valid token here" expireHandler:^(void (^ handler)(NSString *  expireHandler))
	 {
		// Token refresh code here
	}];
	
	Builder* faceVariantBuilder = [ONFaceStepVariantConfig builder];
	[faceVariantBuilder withVideoCaptureWithConfig:NULL];
	ONFaceStepVariantConfig* variantConfig = [faceVariantBuilder buildAndReturnError:&configError];
	
	// variantConfig error handling here
	
	[configBuilder withFaceStepOfVariant:variantConfig];
	[configBuilder withCustomLocalizationWithTableName:@"Onfido"];

	NSError* documentVariantError = nil;
	ONDocumentTypeVariantConfig* documentVariantConfig = nil;
	DocumentConfigBuilder* documentVariantBuilder = [ONDocumentTypeVariantConfig builder];
	[documentVariantBuilder withNationalIdentityCardWithConfig:[[NationalIdentityConfiguration alloc] initWithDocumentFormat:DocumentFormatCard country:@"NLD"]];
	documentVariantConfig = [documentVariantBuilder buildAndReturnError:&documentVariantError];
	
	// documentVariantConfig error handling here

	if(documentVariantConfig != nil)
	{
		[configBuilder withDocumentStepOfType:documentVariantConfig];
	}
	
	ONFlowConfig* config = [configBuilder buildAndReturnError:&configError];
	if(configError == NULL)
	{
		ONFlow* onFlow = [[ONFlow alloc] initWithFlowConfiguration:config];
		// Flow continues...
	}

Steps to reproduce:

This happens with all document configurations where we can provide a country.

lmmenge avatar Jun 23 '22 07:06 lmmenge