Add fields to validations in agent portal
Sometimes you need to add some extra information to the back-end server further than ID card extracted data. For this purpose, MobbScan SDK allows sending to the agent portal as many extra fields as you desire, sending the information as key/value maps.
First of all, MobbScanAPI's baseUrl must be configured with an agent portal URL. That means that the URL should looks like this:
MobbScanAPI.getInstance().baseURL = "https://pre.mobbscan.mobbeel.com/mobbscan-agent"
[[MobbScanAPI getInstance] setBaseURL:@"https://pre.mobbscan.mobbeel.com/mobbscan-agent"];
The extra fields must be posted once the scanning process has ended and the information has been stored on the agent portal. In order to doing this, you may call this method:
let parameter = ["phone": "6564654"]
MobbScanAPI.getInstance().addExtraParameter(parameter, forValidationWithScanId: "YOUR_SCANID", withSuccess:{
}, failure: { error in
})
NSDictionary* parameter = @{@"phone":@"6564654"};
[[MobbScanAPI getInstance] addExtraParameter:parameter
forValidationWithScanId:"YOUR_SCANID"
withSuccess:^(){
NSLog(@"Parameter added properly");
} failure:^(NSError* error){
NSLog(@"Failure adding parameter");
}];
As you can see, the "extra field" is created as a Dictionary
/ NSDictionary
and sent to MobbScan API with the addExtraParameter
method. Once the data has been posted on the server, you will receive feedback on the success
or failure
blocks.