Skip to content

fix: explicitly grant URI permissions for photo/video capture intents#57

Merged
alexgerardojacinto merged 2 commits into
mainfrom
fix/RMET-5241-implicit-uri-grants
Jul 8, 2026
Merged

fix: explicitly grant URI permissions for photo/video capture intents#57
alexgerardojacinto merged 2 commits into
mainfrom
fix/RMET-5241-implicit-uri-grants

Conversation

@alexgerardojacinto

@alexgerardojacinto alexgerardojacinto commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Description

The WebView file chooser's takePictureIntent (ACTION_IMAGE_CAPTURE) and takeVideoIntent (ACTION_VIDEO_CAPTURE) sent no URI grant flags at all for their FileProvider output URIs. Added FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION to both. Also bumped the library version to 2.0.1.

Context

Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE intents (and similarly affects ACTION_VIDEO_CAPTURE) — apps must now explicitly request read/write access, or the camera app silently fails to write the captured media back into the URI.

More info: https://developer.android.com/about/versions/17/behavior-changes-all#restrict-implicit-uri-grants

RMET-5241

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Tests

Manual: exercised the WebView file chooser's photo capture and video record flows via the capacitor-os-inappbrowser plugin's openInWebView, built locally against this branch. Confirmed both work on Android 8 (this library's minSdk) and Android 17.

Screenshots (if appropriate)

N/A

Checklist

  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE
(and similarly affects ACTION_VIDEO_CAPTURE) intents. The file chooser's
takePictureIntent and takeVideoIntent sent no grant flags for their
FileProvider output URIs.

RMET-5241
@alexgerardojacinto alexgerardojacinto merged commit 9dd4be9 into main Jul 8, 2026
7 of 8 checks passed
@alexgerardojacinto alexgerardojacinto deleted the fix/RMET-5241-implicit-uri-grants branch July 8, 2026 13:13
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.

2 participants