Passport MRZ Scanner SDK iOS
Passport MRZ Scanner SDK for iOS
To obtain a license key, please email your application’s Bundle ID to support@idscan.net
Implementation
Objective-C
Add BarcodeScanner.framework to your project
Delete duplicate from “Linked Frameworks and Libraries” section
Add mrz_190307_022802.tflite in project Build Phases->Copy Bundle Resources
Add ScannerViewController
Developers should send an email to support@idscan.net with their app’s Bundle ID in order to receive your “cameraKey”. Make sure you provide your order number if you ready to upgrade from trial to production.
To register the library use
[scanner registerMRZKey:@"MRZKey"];
To get the result from the image utilize
NSString *result = [self.scanner detectMRZ:frameBuffer width:(int)self->width height:(int)self->height];
If you plan to customize the camera interface, in the method
(void) CustomeOverlay
for all elements apply[self.view bringSubviewToFront:elementName];
Swift
In you Swift project you should follow the same way, as in the Objective-C:
Add BarcodeScanner.framework and our camera class (ScannerViewController) to you project
Make you own class and Inheritance it from ScannerViewController, add a “Close” button to your Camera view controller (don’t forget to move the button to the front)
class SwiftViewController: ScannerViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) let rect : CGRect = CGRect(x: 20, y: 20, width: 100, height: 30) let close: UIButton = UIButton(frame: rect) close.setTitle("Close", for: .normal) close.backgroundColor = UIColor.darkGray close.addTarget(self, action: #selector(closeBtn), for: .touchUpInside) self.view.addSubview(close) self.view.bringSubview(toFront: close) } }
If you want to make you own Camera Class from scratch you should do this:
- Import BarcodeScanner.framework to you project
import BarcodeScanner
- Make instance of scanner
var scanner = Barcode2DScanner()
- Register camera with you key (for example from UserDefaults)_
scanner.registerMRZKey("MRZKey")
- Call detectMRZ(UnsafeMutablePointer!, width: Int32, height: Int32) method from instance:
var result = scanner.detectMRZ(UnsafeMutablePointer!, width: Int32, height: Int32)
Swift implementation of our framework you can download HERE.
Note
If you have "Could not find or use auto-linked library" while archiving your app it's xcode issue. You can find more about the problem and workaround by this link.
To obtain a license key
IDScan.net offers a licensing model based on the 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