Skip to content

Fix(camera): bug in SDK 33 where opening the gallery when taking a picture fails due to permissions#1331

Closed
modus-jose wants to merge 2 commits intoionic-team:mainfrom
modus-jose:main
Closed

Fix(camera): bug in SDK 33 where opening the gallery when taking a picture fails due to permissions#1331
modus-jose wants to merge 2 commits intoionic-team:mainfrom
modus-jose:main

Conversation

@modus-jose
Copy link
Copy Markdown

@modus-jose modus-jose commented Dec 14, 2022

Problem

With the release of Android 13, SDK 33 the permission for accesing media files changed.
https://developer.android.com/about/versions/13/behavior-changes-13

When using the camera plugin
It gives the option to open the gallery which fails with a no permissions error in Android 13.

Even when adding permissions in an ionic app, this plugin still doesn't has the permission to read media files

Solution

Detect if the app is using the sdk 33, and grant/check the proper permissions

@modus-jose modus-jose changed the title Fix bug in SDK 33 where opening the gallery when taking a picture fails due to permissions Fix(camera): bug in SDK 33 where opening the gallery when taking a picture fails due to permissions Dec 14, 2022
Copy link
Copy Markdown
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

the alias should be a simpler string, maybe call it media?

The new alias should be added to the types so it can be requested independently
https://github.com/ionic-team/capacitor-plugins/blob/main/camera/src/definitions.ts#L5-L10

And also should be documented in the README

@markemer
Copy link
Copy Markdown
Member

Address @jcesarmobile's comments and conflicts and this should be gtg.

@jcesarmobile
Copy link
Copy Markdown
Member

This was addressed by the linked PR from chace

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.

4 participants