IDScan.net
Search Results for

    Show / Hide Table of Contents

    Passport MRZ Scanner SDK iOS

    Passport MRZ Scanner SDK for iOS

    MRZ Scanner SDK + example

    To obtain a license key, please email your application’s Bundle ID to support@idscan.net

    Implementation

    Objective-C

    1. Add BarcodeScanner.framework to your project

      BarcodeScanner.framework

    2. Add BarcodeScanner.framework in Embedded Binaries Embedded Binaries

    3. Delete duplicate from “Linked Frameworks and Libraries” section Linked Frameworks and Libraries

    4. Add mrz_190307_022802.tflite in project Build Phases->Copy Bundle Resources Copy Bundle Resources

    5. Add ScannerViewController

      ScannerViewController

    6. 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.

    7. To register the library use [scanner registerMRZKey:@"MRZKey"];

      CameraLibrary

    8. To get the result from the image utilize

      NSString *result = [self.scanner detectMRZ:frameBuffer width:(int)self->width height:(int)self->height];
      

      ImageResult

    9. If you plan to customize the camera interface, in the method (void) CustomeOverlay for all elements apply [self.view bringSubviewToFront:elementName];

      CustomizeInterface

    Swift

    In you Swift project you should follow the same way, as in the Objective-C:

    1. Add BarcodeScanner.framework and our camera class (ScannerViewController) to you project

    2. 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:

    1. Import BarcodeScanner.framework to you project
    import  BarcodeScanner
    1. Make instance of scanner
    var scanner = Barcode2DScanner()
    1. Register camera with you key (for example from UserDefaults)_
    scanner.registerMRZKey("MRZKey")
    1. 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

    In This Article
    • Implementation
      • Objective-C
      • Swift
    • To obtain a license key
    Back to top IDScan.net IDScan.net GitHub