Skip to content

fix: apply presentationStyle in chooseFromGallery - #15

Merged
andredestro merged 1 commit into
mainfrom
fix/choose-from-gallery-presentation-style
Apr 23, 2026
Merged

fix: apply presentationStyle in chooseFromGallery#15
andredestro merged 1 commit into
mainfrom
fix/choose-from-gallery-presentation-style

Conversation

@andredestro

Copy link
Copy Markdown
Collaborator

Problem

The presentationStyle option was silently ignored when calling chooseFromGallery on iOS, always presenting the gallery in fullscreen regardless of the configuration passed.

Two root causes:

  1. IONCAMRGalleryOptions did not have a presentationStyle property — the field was never declared, never added to CodingKeys, and never decoded from JSON. As a result, JSONDecoder discarded it silently.

  2. IONCAMRGalleryBehaviour.displayPhotoLibraryView hardcoded .fullScreen — even if the property had existed, the presentation style was never applied to the UINavigationController.

For comparison, takePhoto handled this correctly: IONCAMRTakePhotoOptions extends IONCAMRMediaOptions (which has presentationStyle) and IONCAMRPickerBehaviour applies it via mediaOptions.presentationStyle.uiModalPresentationStyle.

Changes

IONCAMRGalleryOptions

  • Added presentationStyle: IONCAMRPresentationStyle property (default .fullscreen)
  • Added presentationStyle to CodingKeys and init(from decoder:)

IONCAMRGalleryBehaviour

  • chooseFromGallery(with:) now passes options.presentationStyle to displayPhotoLibraryView
  • displayPhotoLibraryView accepts presentationStyle as a parameter and applies it to navController.modalPresentationStyle instead of the hardcoded .fullScreen

Notes

@andredestro andredestro changed the title fix(ios): apply presentationStyle in chooseFromGallery fix: apply presentationStyle in chooseFromGallery Apr 22, 2026
@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Apr 22, 2026

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested here by pointing the Capacitor plugin's Package.swift to this PR's branch and changing the Presentation Style option in the "Gallery" screen, and it's correctly changing the UI for the photo picker. Approved 🤌

@andredestro
andredestro merged commit 05241b8 into main Apr 23, 2026
5 checks passed
@andredestro
andredestro deleted the fix/choose-from-gallery-presentation-style branch April 23, 2026 08:50
capacitor-bot pushed a commit that referenced this pull request Apr 23, 2026
## [1.0.4](1.0.3...1.0.4) (2026-04-23)

### Bug Fixes

* **ios:** apply presentationStyle in chooseFromGallery ([#15](#15)) ([05241b8](05241b8))
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.

[Bug]: presentationStyle not working on iOS

2 participants