Skip to content

feat(android): add galleryImportAllowed option to scanDocument#178

Open
IshuKaur wants to merge 1 commit into
WebsiteBeaver:masterfrom
IshuKaur:feat/gallery-import-and-namespace-fix
Open

feat(android): add galleryImportAllowed option to scanDocument#178
IshuKaur wants to merge 1 commit into
WebsiteBeaver:masterfrom
IshuKaur:feat/gallery-import-and-namespace-fix

Conversation

@IshuKaur
Copy link
Copy Markdown

@IshuKaur IshuKaur commented Jun 4, 2026

Problem

Currently the document scanner only allows capturing images via camera.
There is no way to import existing images from the device gallery.

Solution

Adds a new galleryImportAllowed boolean option to scanDocument.
When set to true, the Google ML Kit scanner shows a gallery import
button alongside the camera, allowing users to pick existing images
from their device.

Changes

  • src/NativeDocumentScanner.ts — adds galleryImportAllowed?: boolean
    to ScanDocumentOptions interface with JSDoc
  • android/src/main/java/com/documentscanner/DocumentScannerModule.kt
    reads the option and passes it to GmsDocumentScannerOptions.setGalleryImportAllowed()

Usage

DocumentScanner.scanDocument({ galleryImportAllowed: true })

Adds a new `galleryImportAllowed` boolean option that lets users import
images from the device gallery in addition to capturing with the camera.
Wires through to GmsDocumentScannerOptions.setGalleryImportAllowed().
Defaults to false to preserve existing behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant