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 posting to Agent portal as many extra fields as you desire, sending the information as key/value maps.
First of all, API base-url must be configurated 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:NSDictionary = ["phone":"6564654"]
MobbScanAPI.getInstance().addExtraParameter(parameter as! [AnyHashable : Any], 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 NSDictionary and sent to MobbScan API by method addExtraParameter
. Once the data has been posted on the server, you will receive a feedback message by Success block or failure block will be invoked in case of any error occurs.