Skip to content

Migration Guide: From 4.x To 5.x

From v5.7 To v5.8

ProcessParams have all the properties exposed as NSNumber to support the optionality for Objective-C.

For Swift

If you set up ProcessParams using literals (such as true \ false, numbers, etc.), the Swift compiler will bridge the literals under the hood. If you need to use variables, add as NSNumber explicitly.

For example:

// Old ⛔️
DocReader.shared.processParams.barcodeTypes = [BarcodeType.QRCODE.rawValue, BarcodeType.AZTEC.rawValue]

// New ✅
DocReader.shared.processParams.barcodeTypes = [BarcodeType.QRCODE.rawValue as NSNumber, BarcodeType.AZTEC.rawValue as NSNumber]

For Objective-C

Note that in v5.8 almost all the ProcessParams properties are NSNumber.

Prefix all the literals for NSNumber with the @ sign, for example:

[RGLDocReader shared].processParams.logs = @YES;
[RGLDocReader shared].processParams.barcodeParserType = @123;
[RGLDocReader shared].processParams.timeout = @20;

Find more examples on the Configuration page.

From v5.1 To v5.2

Note that in v5.2 errors are returned as NSError.

Make sure to update the database along with the SDK.

From v5.0 To v5.1

Make sure to update the database along with the SDK.

From v4.2 To v5.0

Note that in v5.0 the DocReader class is a singleton.

Declare the Configuration settings the following way:

DocReader.shared.processParams.scenario = "Mrz"
DocReader.shared.customization.showResultStatusMessages = true

To get the results continuously, invoke the startNewSession() function:

switch action {
case .complete:
    // pause current scanning session
    DocReader.shared.isCameraSessionIsPaused = true

    // handle results
    // continue the scanning process
    DocReader.shared.isCameraSessionIsPaused = false

Document Type Result

documentType is an array that contains information about each read page.

Graphic Result

gf_DocumentRear was removed; gf_DocumentFront was renamed to gf_DocumentImage (see GraphicFieldType enum).

In order to get the appropriate document side, use the new property pageIndex that is available in the DocumentReaderGraphicResult class.

For example, pageIndex = 0 is the first (front) side of the document; pageIndex = 1 is the second (back) side of the document.