In this section, we've included some examples of SDK usage below.

1. Open the Camera Scanner and Scan Documents

1.1. Start Scanner for Driver Licence and ID card

This section offers code samples to start scanners for the Driver Licence and ID card:
Code Sample:

if let orbitIdVC = Orbit4ScanIDViewController.init(delegate: self) {

    self.present(orbitIdVC, animated: true, completion: nil)
}

1.1.1. Start the Scanner with the Document Type

📘

Note:

Please initialize the function to Launch the Driver Licence SDK first.

This section offers code samples to Start the scanners for the Driver's Licence and ID Card with a set of the document type.

Code Sample:

orbitIdVC.requestParam = "";

Below is an example of the use case of the document type code.

Code Sample:

if let orbitIdVC = Orbit4ScanIDViewController.init(delegate: self) {
    // Set Document Type
    orbitIdVC.requestParam = "AUS_AUTO_DRIVERLICENCE"

    self.present(orbitIdVC, animated: true, completion: nil)
}

These are some compatible document types that can be used when Starting the scanner for specific document types:

"AUS_AUTO_DRIVERLICENCE"
"AUS_ACT_DRIVERLICENCE"
"AUS_NSW_DRIVERLICENCE"
"AUS_NT_DRIVERLICENCE"
"AUS_QLD_DRIVERLICENCE"
"AUS_SA_DRIVERLICENCE"
"AUS_TAS_DRIVERLICENCE"
"AUS_VIC_DRIVERLICENCE"
"AUS_WA_DRIVERLICENCE"
"AUS_IMMICARD"
"CAN_AB_DRIVERLICENCE"
"CAN_BC_DRIVERLICENCE"
"CAN_ON_DRIVERLICENCE"
"NZL_DRIVERLICENCE"

1.1.2. Enable/Disable Back Card Scan

📘

Note:

If back scanning is enabled, a dialog box will appear asking whether to continue scanning the back card or not when the front card scan is complete.

This section offers the code sample for enabling or disabling the back card scan.
You can set the value to True to enable the Back Card Scan.
You can set the value to False to disable the Back Card Scan.

Code Sample:

orbitIdVC.scanBackSide =  // true to enable // false to disable

Below is an example of the use case of the back card scan code.

Code Sample:

if let orbitIdVC = Orbit4ScanIDViewController.init(delegate: self) {
    // Set Document Type
    orbitIdVC.requestParam = "AUS_AUTO_DRIVERLICENCE"
    
    // To be enable back card scan here
    orbitIdVC.scanBackSide = true 

    self.present(orbitIdVC, animated: true, completion: nil)
}

1.2. Start Scanner for Passport

This section offers code samples to start scanners for the Passport card:

Code Sample:

if let orbitMrzVC = OrbitMrzViewController.init(delegate: self) {
  
    orbitMrzVC.requireImage = true
    
    self.present(orbitMrzVC, animated: true, completion: nil)
}

1.2.1. Scan Mode for Passport

📘

Note:

Please initialize the function to Launch the Passport SDK first.

The passport code function requires the scan mode to be a valid function.
There are 2 scan modes for Passport.
Below is the code to scan automatically.

Code Sample:

orbitMrzVC.scanMode = .camera

Below is the code to scan manually.

Code Sample:

orbitMrzVC.scanMode = .photo

Below is an example of the use case of the scan mode on the Passport card function.

Code Sample:

if let orbitMrzVC = OrbitMrzViewController.init(delegate: self) {
    // Set Scan Mode
    orbitMrzVC.scanMode = .camera
    orbitMrzVC.requireImage = true
    
    self.present(orbitMrzVC, animated: true, completion: nil)
}

1.3. Start Scanner for Medicare

This section offers code samples to start scanners for the Passport card:

Code Sample:

if let orbitMedicareVC = Orbit4MedicareViewController.init(delegate: self) {                

    
    self.present(orbitMedicareVC, animated: true, completion: nil)
}

1.3.1. Medicare Document Type

Medicare has a specific document type for the function to be valid.
Below are the document type function required for Medicare.

Code Sample:

orbitMedicareVC.requestParam = "AUS_MEDICARE"

📘

Note:

The Medicare document type must be set to "AUS_MEDICARE".

2. Camera UI Customisation

The Camera UI may be customized in a variety of ways. The following is an example of some of the customization:

2.1. Add a Header Title and Subtitle Message

The attributes exists for all 3 frameworks (MRZ, 4ScanID, and Medicare). The main attributes to look for are:

  • overlayHeaderLabelColor
  • overlayHeaderLabelTextSize
  • overlayHeaderLabelText
  • overlaySubLabelColor
  • overlaySubLabelTextSize
  • overlaySubLabelText

📘

Note:

4ScanID is the Binding.

Please find the following code below for an example of the code above.

Code Sample:

orbitVC.overlayHeaderLabelColor = UIColor.white
orbitVC.overlayHeaderLabelFont = UIFont.boldSystemFont(ofSize: 20)
orbitVC.overlayHeaderLabelText = "Australia Driver Licence"

orbitVC.overlaySubLabelColor  = UIColor.white
orbitVC.overlaySubLabelFont = UIFont.boldSystemFont(ofSize: 12)
orbitVC.overlaySubLabelText = "Put your driver licence in this frame"

The graphic below illustrates how the overlay's code above is implemented in your project application's Camera UI.

11251125

The following are the descriptions from number one to two:

  1. The Overlay Text Box. This text box is located in the middle of the screen.
  2. The Overlay Header Label. This is the heading of the overlay text.
  3. The Overlay Header Label Color. This is the font color of the overlay header.
  4. The Overlay Header Label Color Text Size. This is the font size of the overlay header.
  5. The Overlay Sub Label Text. This is the subheading of the overlay text.
  6. The Overlay Sub Label Text Color. This is the font color of the subheading text.
  7. The Overlay Sub Label Text Size. This is the font size of the subheading text.

2.2. Hiding of Branding and Buttons on the Camera UI

To set the hiding of the branding and buttons on the Camera UI, please refer to the code sample below.

Code Sample:

orbitVC.closeButton.buttonVisible = true
orbitVC.settingButton.buttonVisible = true
orbitVC.recaptureButton.buttonVisible = false
orbitVC.cameraSwitchButton.buttonVisible = true
orbitVC.manualEntryButton.buttonVisible = true
orbitVC.useThisImageButton.buttonVisible = false

The graphic below illustrates how the hiding of the branding and buttons on the Camera UI's code above is implemented in your project application's Camera UI.

11251125

The following are the descriptions from number one to four:

  1. The Close Button. This functions to close the scanning process.
  2. The Setting Button. This functions to open the scanning process's settings.
  3. The Camera Switch Button. This functions to toggle between the front and rear cameras.
  4. The Manual Entry Button. This button has no action value, it closed the camera control.

2.3. Customize the colors of the Preview Screen

The colors of the Preview Screen can be customized using the 4ScanID framework.
Below are the available properties to customize the Preview Screen on the 4ScanID framework.

🚧

Important:

This feature is still in experimental settings and may not work well, proceed with caution.

Code Sample:

@property (nonatomic, retain, readwrite) UIColor*backColor;
@property (nonatomic, retain, readwrite) UIColor*bodyFontColor;
@property (nonatomic, retain, readwrite) UIColor*bodyDetailFontColor;
@property (nonatomic, retain, readwrite) UIColor*headerFontColor;
@property (nonatomic, retain, readwrite) UIColor*buttonFontColor;

2.4. Set Date Format

The Date Format can be set, please see the code below.

Code Sample:

orbitVC.dateFormat = "DD/MM/YYYY"

Here is the date format that our SDKs support:

Date Format

Display Name

DD/MM/YYYY

31/12/2015

DD/MM/YY

31/12/15

MM/DD/YYYY

12/31/2015

MM/DD/YY

12/31/15

DD MMM YYYY

31 Dec 2015

DD MMMM YYYY

31 December 2015

The graphic below illustrates how the date format code above is implemented in your project application's Camera UI. The Date format appears on the setting section after clicking the Setting button.

11251125

2.5. Set Camera Orientation

The Camera Orientation can be set, please see the code below.

Code Sample:

orbitVC.cameraViewOrientation = .portrait

The graphic below illustrates how the camera orientation code above is implemented in your project application's Camera UI. The camera orientation appears on the setting section after clicking the Setting button.

11251125

2.6. Show Capture Preview

Show Capture Preview is a feature where you can preview the document prior to taking a picture of that document. To show capture preview put true value and false value not to show capture preview. Please refer to the code sample below:

public boolean showCapturePreview = true;

The graphic below illustrates how the show capture preview code above is implemented in your project application's Camera UI. The show capture preview appears in the setting section after clicking the Setting button.

11251125

3. Understanding the Result

Once data has been captured and processed, it will be returned to the respective framework delegate functions.
Below is a sample code for the delegate functions:

3.1. Driver Licence and ID Card Results

The Driver Licence and ID card result delegate functions.

Code Sample:

extension SelectIdentityVC: Orbit4ScanIDResultDelegate {

}

To star result on the Driver's License and ID card, Insert the following code on the delegate function above.

Code Sample:

extension SelectIdentityVC: Orbit4ScanIDResultDelegate {
    
    func responseOrbit4ScanIDResult(_ sdkVC: Orbit4ScanIDViewController!, result: ScanIDOCRResult, imageDocFront imgDocF: UIImage!, imageDocBack imgDocB: UIImage!, imgDocFace: UIImage!, imageCameraFace imgCamFace: UIImage!) {
        
        if result.statusCode == nil || result.statusCode == "210" || result.statusCode == "240" { // Cancelled
            self.dismiss(animated: true, completion: nil)
            return
        }
        
        let resultsVC = self.initResultsVC(documentType: .driverLicence)
        resultsVC.scanIdResult = result
     
        var images = [UIImage]()
        
        if imgDocF != nil {
            images.append(imgDocF)
        }
        
        if imgDocB != nil {
            images.append(imgDocB)
        }
        
        if imgDocFace != nil {
            images.append(imgDocFace)
        }
        
        if imgCamFace != nil {
            images.append(imgCamFace)
        }
        
        resultsVC.images = images
        
        self.dismiss(animated: true) {
            self.present(resultsVC, animated: true, completion: nil)
        }
    }    
}

The result of the aforementioned Driver's license above will be returned in an object such as ScanIDOCRResult. Inside ScanIDOCRResult, you can access data such as the card type, license type, and user's personal information. Result details are shown in the following found in the header:

@interface ScanIDOCRResult : NSObject {
}
    @property (nonatomic, retain, readwrite) ScanIDResultField *  cardType;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  countryOfIssue;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  issuer;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  lastName;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  firstName;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  middleName;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  dOB;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  expiryDate;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  licenceNumber;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  address;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  street;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  city;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  state;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  zipCode;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  licenceClass;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  licenceCondition;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  licenceType;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  expired;
    @property (nonatomic, retain, readwrite) ScanIDResultField *  over18;
    @property (nonatomic, retain, readwrite) NSString * statusCode;
    @property (nonatomic, retain, readwrite) NSString * statusMessage;
    @property (nonatomic, retain, readwrite) NSString * resultString;
@end

3.2. Passport Results

The Passport result delegates functions.

Code Sample:

extension SelectIdentityVC: OrbitMrzViewControllerDelegate {
}

To star result on the Passport, Insert the following code on the delegate function above.

Code Sample:

extension SelectIdentityVC: OrbitMrzViewControllerDelegate {
    
    func responsed(_ response: MRZOCRResult, with image: UIImage!, face imgFace: UIImage!, in orbitVC: OrbitMrzViewController!) {
        
        if response.statusCode == "210" || response.statusCode == "240" { // Cancelled
            self.dismiss(animated: true, completion: nil)
            return
        }
        
        let resultsVC = self.initResultsVC(documentType: .passport)
        
        resultsVC.mrzResult = response
        
        var images = [UIImage]()
        
        if image != nil {
            images.append(image)
        }
        
        if imgFace != nil {
            images.append(imgFace)
        }
        
        resultsVC.images = images
        
        self.dismiss(animated: true) {
            self.present(resultsVC, animated: true, completion: nil)
        }
    }
}

The result of the aforementioned Passport above will be returned in an object such as MRZOCRResult. Inside MRZOCRResult, you can access data such as the document type, and user's personal information. Result details are shown in the following found in the header:

@interface MRZOCRResult : NSObject {
}
    @property (nonatomic, retain, readwrite) MRZResultField * documentType;
    @property (nonatomic, retain, readwrite) MRZResultField * countryOfIssue;
    @property (nonatomic, retain, readwrite) MRZResultField * lastName;
    @property (nonatomic, retain, readwrite) MRZResultField * firstName;
    @property (nonatomic, retain, readwrite) MRZResultField * middleName;
    @property (nonatomic, retain, readwrite) MRZResultField * documentNumber;
    @property (nonatomic, retain, readwrite) MRZResultField * nationality;
    @property (nonatomic, retain, readwrite) MRZResultField * dateOfBirth;
    @property (nonatomic, retain, readwrite) MRZResultField * sex;
    @property (nonatomic, retain, readwrite) MRZResultField * dateOfExpiry;
    @property (nonatomic, retain, readwrite) MRZResultField * personalNumber;
@end

3.3. Medicare Results

The Medicare result delegates functions.

Code Sample:

extension SelectIdentityVC: Orbit4MedicareResultDelegate {
}

To star result on the Medicare, Insert the following code on the delegate function above.

Code Sample:

extension SelectIdentityVC: Orbit4MedicareResultDelegate {
    
    func responseOrbit4MedicareResult(_ medicareVC: Orbit4MedicareViewController!, result: MedicareOCRResult, frontImage: UIImage!, back backImage: UIImage!, face faceImage: UIImage!) {
        
        if result.statusCode == nil || result.statusCode == "210" || result.statusCode == "240" { // Cancelled
            self.dismiss(animated: true, completion: nil)
            return
        }

        let resultsVC = self.initResultsVC(documentType: .medicare)
        resultsVC.medicareResult = result
        
        var images = [UIImage]()
        
        if frontImage != nil {
            images.append(frontImage)
        }
        
        if backImage != nil {
            images.append(backImage)
        }
        
        if faceImage != nil {
            images.append(faceImage)
        }
        
        resultsVC.images = images
        
        self.dismiss(animated: true) {
            self.present(resultsVC, animated: true, completion: nil)
        }
    }
}

The result of the aforementioned Medicare above will be returned in an object such as MedicareOCRResult in a JSON format. Inside MedicareOCRResult, you can access data such as the card type, and user's personal information. Result details are shown in the following found in the header:

@interface MedicareOCRResult : NSObject {
}
@property (nonatomic, retain, readwrite) MedicareResultField *cardType;
@property (nonatomic, retain, readwrite) MedicareResultField *countryOfIssue;
@property (nonatomic, retain, readwrite) MedicareResultField *issuer;
@property (nonatomic, retain, readwrite) MedicareResultField *medicareId;
@property (nonatomic, retain, readwrite) MedicareResultField *identifierNo;
@property (nonatomic, retain, readwrite) MedicareResultField *issueNo;
@property (nonatomic, retain, readwrite) MedicareResultField *checkSum;
@property (nonatomic, retain, readwrite) MedicareResultField *user1;
@property (nonatomic, retain, readwrite) MedicareResultField *user2;
@property (nonatomic, retain, readwrite) MedicareResultField *user3;
@property (nonatomic, retain, readwrite) MedicareResultField *user4;
@property (nonatomic, retain, readwrite) MedicareResultField *user5;
@property (nonatomic, retain, readwrite) MedicareResultField *validTo;
@property (nonatomic, retain, readwrite) MedicareResultField *mark;
@property (nonatomic, retain, readwrite) MedicareResultField *hologram;
@property (nonatomic, retain, readwrite) MedicareResultField *cardColor;
@property (nonatomic, retain, readwrite) NSString  * statusCode;
@property (nonatomic, retain, readwrite) NSString  * statusMessage;
@property (nonatomic, retain, readwrite) NSString  * resultString;
@end

💬 We're here to help!

If you encounter an issue, a bug, or require assistance, please contact our support page here to find the solution. Don't forget to provide any important information on the issue.