Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageswift
        let giniBankConfigurationginiConfiguration = GiniBankConfigurationGiniConfiguration.shared
        ...
        ...
        giniBankConfigurationginiConfiguration.openWithEnabled = true

3. Handle incoming PDFs and images

...

Code Block
languageswift
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
}

...