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.



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, 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:
 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" ;
    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.


Using the Parser Library in SWIFT application does not differ in coordination from the Objective-C Application, you just need to graft the framework to you project by correct way.

  1. At first you should place libDriverLicenseParser.a (lib file),  DriverLicenseParser.h (header file) and dlpSerial.txt (key file) to any folder on hard-drive (for example you project folder).
  2. Second step is putting library to project. Just Drag-and-Drop or use any other way, as you wish and pick target for adding.

  3. After that you need to make a Objective-C Header File in the project with «insert» line.
  4. Put this file path to project options (Target – Build Settings – Objective-C Bridging Header).
  5. Point Framework Search Path where is located the lib-file in the project options (Target – Build Settings).
  6. Also you should switch «Build Active Architecture Only» to «NO» option. If You don’t do that you will receive «Compilation error» during Building you project.
  7. OK, it’s time to make some code. You don’t need to insert the library header in each controller, where you want to use it because the framework is visible throughout the project area. Just make an instance of class and use it by calling ParseDLString method.
let dl = DriverLicense()
dl.parseDLString(, hideSerialAlert: )
var outputString : String = ""
for  (key , value) in dl.fields! {
	outputString += "\(key.description) : \(value)\n"

Please note, in demo mode (without the serial key) almost all fields will be display as **DEMO**. To change it you should put KEY to dlpSerial.txt file.

That’s it.

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

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 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 [email protected] 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.