diff --git a/CHANGELOG.md b/CHANGELOG.md index f5a593b..476632e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 The changes documented here do not include those from the original repository. +## [1.0.2] + +### 2026-07-07 + +- Fix: explicitly grant `FLAG_GRANT_READ_URI_PERMISSION` (in addition to the existing write permission) when launching camera capture intents, required for Android 18's implicit URI grant restriction ([RMET-5241](https://outsystemsrd.atlassian.net/browse/RMET-5241)). + ## [1.0.1] ### 2026-04-27 diff --git a/pom.xml b/pom.xml index e489da6..99f0ccf 100644 --- a/pom.xml +++ b/pom.xml @@ -6,5 +6,5 @@ 4.0.0 io.ionic.libs ioncamera-android - 1.0.1 + 1.0.2 diff --git a/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt b/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt index 37ac171..d9b2143 100644 --- a/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt +++ b/src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRMediaHelper.kt @@ -29,7 +29,7 @@ class IONCAMRMediaHelper : IONCAMRMediaHelperInterface { if (activity != null && imageUri != null) { val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri) - intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION) + intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION) val mPm: PackageManager = activity.packageManager if (intent.resolveActivity(mPm) != null) { activity.startActivityForResult( @@ -49,8 +49,8 @@ class IONCAMRMediaHelper : IONCAMRMediaHelperInterface { val safeActivity = activity ?: return null val safeUri = imageUri ?: return null val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) - intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri) - intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION) + intent.putExtra(MediaStore.EXTRA_OUTPUT, safeUri) + intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_READ_URI_PERMISSION) return if (intent.resolveActivity(safeActivity.packageManager) != null) { intent