Profile Hot-Swapping – GBG IDscan Documentation

Profile Hot-Swapping

Briefly, hot swapping allows changing profiles before each Customer Journey or Document Scanner calls. Since storing all documents on the device would result in large app size, this should enable more flexibility for document scanning for a different countries, document types or regions.

Requirements:

  • Technical Account team will provide all required Profile packages as .zip.
  • Customer (You) is responsible for storing, managing, downloading and pre-installing profiles on the device.

Hot-Swapping implementation.? 

Install selected profile, for this you need .zip path and selected TAG. Tags can be any name selected by you. Few examples EUROPE, ASIA, France, Belgium, EUROPE_ID_CARDS or COLECTION1.? Please note, that once you install the profile we extract the zip file into the filesystem private Library folder, hence if you don’t need the profile anymore, please use utility method to remove them.

Swift

do {
     try IDESProfileManager.install((profilePath?.path)!, withTag: tagName)
     UIAlertController.showPopup(title: "Install Profile", message: "Successfuly installed profile: \(tagName)", presenter: self)
} catch {
     UIAlertController.showPopup(title: "Install Profile", message: "Failed to install profile: \(tagName) \n\(error.localizedDescription)", presenter: self)
}

Note: IDESProfileManager.install function handles profiles updates too. If you provide never version of the profile with the same tag, it will check versions and update if needed, hence you can always call install

Tell MJCS that you want to use this profile

Swift

MJCS.swap(with: profile, withCompletion: { (success: Bool, exception: NSException?) in
                if let exception = exception {
                    UIAlertController.showPopup(title: "Select Profile Exception", message: exception.reason, presenter: self)
                } else {
                    UIAlertController.showPopup(title: "Select Profile", message: "Succesfully selected profile: \(profile.tag)", presenter: self)
                }
})

Launch IDSDocumentScannerController or IDSCustomerJouneyController

Note: TAG can be any name except “default” as this is reserved and used if you switching back to default profile.? 

If you want to switch back to the default profile

Swift

MJCS.swap(withTag: IDESDefaultProfile, withCompletion: nil)

Was this page helpful?