Customer Journey / Digital Journey / On-boarding Customers
This is best suited for fast and easy integration with your code, allows no UI customisation.
This is how you can achieve this:
Assuming that users are going to run customer journey method using openCamera action.
- (IBAction)openCamera {
//Initialize customer journey controller
IDSCustomerJourneyController *controller = [[IDSCustomerJourneyController alloc] init];
//Assign delegate
controller.delegate = self;
//Assign credentials
controller.credentials = self.credentials;
// Present View Controller
[self presentViewController:controller animated:YES completion:nil];
}
IDSCustomerJorneyControllerDelegate Methods:
When the scanner is unable to perform its duties.
- (void)customerJourneyController:(IDSCustomerJourneyController *_Nonnull)scanner didFailWithError:(NSError *_Nullable)error {
NSLog(@"%@ Error: ", error.localizedDescription);
}
When the user cancelled the scan operation.
- (void)customerJourneyControllerDidCancel:(IDSCustomerJourneyController *_Nonnull)scanner {
[scanner dismissViewControllerAnimated:YES completion:nil];
}
When the scanner recognised a document object in the image.
- (void)customerJourneyController:(IDSCustomerJourneyController *_Nonnull)scanner didFinishJourneyWithResult:(IDSEnterpriseJourneyResponse *_Nullable)result {
//result object is the enterprise back result
[scanner dismissViewControllerAnimated:YES completion:^{
[self performSegueWithIdentifier:@"showResults" sender:self];
}];
}
Note: Smart Capture can only be used on Identity Documents.
Component Base Integration
This section is based on building Customer Journey from customer side. For this we briefly explain:
- Main components
- Logic for Customer Journeys
- Requirements
Assuming that users are going to run the document scanner method from a scanner button that is declared on one of Storyboard’s Controller View.
1. Initializing IDSDocumentScannerController.
- (IBAction)scannerButton:(id)sender {
// Create the controller
IDSDocumentScannerController *controller = [[IDSDocumentScannerController alloc] initWithScannerType:IDSDocumentScannerControllerTypeDocument options:nil];
// Assign Delegate
controller.delegate = self;
// Present View Controller
[self presentViewController:controller animated:YES completion:nil];
}
2. Delegate method when the scanner is unable to perform its duties.
(void)documentScannerController:(IDSDocumentScannerController *)scanner didFailWithError:(NSError *)error {
[scanner dismissViewControllerAnimated:YES completion:nil];
}
3. Delegate method for when the user cancel scan operation.
(void)documentScannerControllerDidCancel:(IDSDocumentScannerController *)scanner;
4. Delegate method for when the scanner recognizes the document object in image successfully.
(void) documentScannerController:(IDSDocumentScannerController *)scannerdidFinishScanningWithInfo:(NSDictionary *)info;
Hot-Swapping
Hot swapping allows to change profiles before each Customer Journey or Document Scanner calls. This should enable more flexible document scanning for different country, type or regions-based requirements.
Requirements:
- The Technical Account team will provide all required Profile packages as .zip.
- Customer (You) is responsible for storing, managing, downloading and pre-installing profiles on device.
Simple hot swapping implementation
1. Install selected profile, for this you need .zip path and selected TAG – tags can be any name selected by you. Few examples EUROPE, ASIA, France, Belgium, EUROPE_ID_CARDS or COLECTION1.
[IDESProfileManager install:@”path.zip” withTag:@”GBR” error:&error];
Note: Once you install the profile, we extract the zip file into the filesystem private Library folder. If you don’t need the profile anymore, please use the utility method to remove them.
2. Swap Profile
[MJCS swapWithTag:@”GBR” withCompletion:nil];
3. Launch DocumentScannerController or CustomerJouneyController.
Note: A TAG can be any name except “default”, as this is reserved and used if you switching back to default profile.
Switching back to the default profile
If you want to switch back to the default profile, which is added in the app bundle, simply use the tag name as default (this will only work if you added default profile).
[MJCS swapWithTag:@”IDESDefaultProfile” withCompletion:nil];
Scanning info results
Example: Recommended approach of Document Scanner Controller scanning result usage:
(void) documentScannerController:(IDSDocumentScannerController *)scanner didFinishScanningWithInfo:(NSDictionary *)info {
IDESDocument *metadata = info[IDSDocumentScannerInfoMetadataObject];
// Check if it was autocaptured
if (metadata.documentImage) {
self.extractedImage = metadata.documentImage;
// All other cases such as utility documents, selfie etc.
} else {
self.extractedImage = info[IDSDocumentScannerInfoImage];
}
Note: Do not use “Smart Capture” (DocumentScannerController with IDSDocumentScannerControllerTypeDocument) to capture A4 documents, use IDSDocumentScannerControllerTypeUtility type or native camera as the required resolution is 4k and Smart Capture is caped at 1080p.
For Selfie images, please use DSDocumentScannerControllerTypeSelfie or the native camera instead.