iOS – ID Parsing SDK

IDScan offers two SDKs for iOS. This page focuses on the ID Parsing SDK for iOS, which allows information from Driver’s Licences and ID’s captured by hardware scanners to be parsed into an iOS application.

ID Parsing SDK – Download

Documentation can be found below.

Contents:

Implementation

Working with the Demo

How to Activate

DL/ID cards are widely used for storing personal information such as first name, last name, birth date, address, hair color, etc. They also contain special information related to driving activity including DL number, class and restrictions. Because of the utility of this data, there is a high demand for mobile applications that can scan and process DL/ID information.

Magnetic Stripe and 2D formats greatly vary from one state to another, causing numerous difficulties when attempting to parse information encoded in each DL. For instance, some cards may contain tracks in the inverted order, while others may use slightly shifted track positions for storing fields.

As a solution, IDScan.net developed a DL/ID Parsing Component for iPhone/iPod. We collected 10+ years of ID formats from the US and Canada and tested each one to ensure every DL/ID card is parsed with precision.  Our DL/ID Parsing Component allows data collection from the following fields:

Document Info: Customer Info:
License Number, Expiration Date, Issue Date, Issued By, IIN, Endorsements Code, Classification Code, Restrictions Code, Specification Full Name, Last Name, First Name, Middle Name, Name Prefix, Name Suffix, Birthdate
Customer address: Customer physical description:
Address1,
 Address2, City, State/Jurisdiction Code, Postal Code, Country Gender (Male or Female), Race, Eye Color, Height, Weight, Hair Color
Implementation top

The DL Parsing Component enables DL/ID parsing capabilities for iOS applications. 
It consists of the following files:

  • DriverLicenseParser.h
  • libDriverLicenseParser.a (static library)

Add the two files as well as all the required frameworks(the ones used in the demo project) and then import DriverLicenseParser.h into your View Controller or other script.
DriverLicenseParser.h parses information scanned from most ID scanners and stores the information in an object called DriverLicense. The code below stores the DriverLicense object in variable dl, then outputs the parsed information to a text box. If the parsing fails, it will log a “Failed” message instead.

/* Input string from magnetic stripe scanners should be composed from tracks separated by any of the following symbols \r\n, \n\n, \r, \n.*/
DriverLicense *dl = [[DriverLicense alloc] init];
NSString* output = nil;
if ([dl parseDLString:inputText hideSerialAlert:(self.chkShowSerial.isOn==NO)] == NO){
    output = @"Failed" ;
}else{
    output = [[dl fields] description];
}
textView.text = [NSString stringWithFormat:@"%@\n=======\n%@",output,[DriverLicense dlpUniqueId]];
[dl release];

To access the parsed information in code, you can access the parsed information field by field:

firstName = dl.firstName;
lastName = dl.lastName;
//etc. The rest of the fields can be found in DriverLicenseParser.h
//Alternatively, use "valueForField:[field]"
//this returns string value for field (for Birthdate and ExpirationDate fields returns string in the format yyyyMMdd, for Gender field returns “Male” or “Female”)
//For example:
birthDate = [dl valueForField:@"Birthdate"]; //19890525

//Dates can be stored in different formats with "valueForDateField" as seen below
birthDate = [dl valueForDateField:@"Birthdate" withFormat:nil]; //Birthdate as NSDate 
birthDate = [dl valueForDateField:@"Birthdate" withFormat:@"MM/dd/yyyy"]; //Birthdate as a formatted string: 05/25/1989 

You can also access the parsed information via the NSDictionary fields, as in the example above, which contains all of the information from the various fields. The NSArray availableFields contains a list of the names of all the fields that were parsed.

Working with the Demo top

In the SDK, the folder “TestReader” contains a simple test project, which demonstrates the functionality of IDScan’s DL/ID Parser Component with most iOS hardware scanners.

-Connecting Action:
Linea Action

After swiping an ID card you will get the following information
Scan

In demo mode (without serial #) almost all fields will display **DEMO** value

Do not forget to point out the appropriate Bundle identifier in DlpTest-Info.plist to work with a real device.

How to Activate – top

IDScan.net offers licensing model based on app’s Bundle ID. You can email us your bundle ID to obtain a trial development key.

Copy your application Bundle ID and email to support@idscan.net

IDScan.net will issue you a unique Serial number/Registration Key for this Bundle ID

There are two ways to apply the serial number.

  1. During design time, paste the serial number in the file dlpSerial.txt in XCode. The file should contain only the serial number. See the screenshot below:

Activate 1

  1. To allow the end user to enter the serial, do it programmatically – by applying the method (yourserial = generated string)

[[NSUserDefaults standardUserDefaults] setValue:yourserial forKey:@"DriverLicenseParserCurrentSerial"];
Activate 2 Activate 3
Click on “Enter DLP serial” to enter serial key.