func application(_ app: UIApplication,
open url: URL,
options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool {
// 1. Build the document
let documentBuilder = GiniCaptureDocumentBuilder(documentSource: .appName(name: sourceApplication))
documentBuilder.importMethod = .openWith
documentBuilder.build(with: url) { [weak self] (document) in
guard let self = self else { return }
// 2. Validate the document
if let document = document {
do {
try GiniCapture.validate(document,
withConfig: giniBankConfigurationginiConfiguration.captureConfiguration())
// Load the GiniCapture with the validated document
} catch {
// Show an error pointing out that the document is invalid
}
}
}
return true
} |