Document Import Guide


If you want to add the document import feature to your app, specify the supported types (fileImportSupportedTypes) on the GiniConfiguration instance.

let giniConfiguration = GiniConfiguration.shared giniConfiguration.fileImportSupportedTypes = .pdf_and_images

These are the cases for document import:

  • pdf

  • pdf_and_images

  • none (In case you want to deactivate document import functionality, including UI related, this is the default value).

Also, if you want to add some custom validations for the imported GiniCaptureDocument, specify them in the GiniConfiguration closure, customDocumentValidations, for example:

giniConfiguration.customDocumentValidations = { document in // As an example of custom document validation, we add a more strict check for file size let maxFileSize = 5 * 1024 * 1024 // 5MB if document.data.count > maxFileSize { throw DocumentValidationError.custom(message: "Diese Datei ist leider größer als 5MB") } }

Import images from camera roll

To enable your app to import images from Photo Gallery and support iOS 10, specify the NSPhotoLibraryUsageDescription key in your Info.plist file. This key is mandatory for all apps since iOS 10 when accessing the Photo Gallery.

Import images and PDFs from other apps

In order to enable your app to import PDFs and images from other apps like Files, Dropbox, or Drive, enable iCloud document support in your app.

For more information take a look at Incorporating iCloud into Your App guide from Apple documentation.