Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix photo not saving in Android example app on Android 13+ #2522

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

Menardi
Copy link
Contributor

@Menardi Menardi commented Feb 7, 2024

What

This PR fixes an issue in the example app which prevented the saving of photos on Android 13+. I came across this when testing #2519 and needed to save some example photos.

On Android 13+, requesting the WRITE_EXTERNAL_STORAGE permission immediately denies, without asking the user. Instead we need to use scoped storage. The @react-native-camera-roll/camera-roll plugin being used already supports using scoped storage for saving images on Android 13+, so all we need to do is skip the permission check in that case.

Changes

  • This PR skips the storage permission check in the example app on Android 13+

Tested on

  • Pixel 7a, Android 14

Related issues

On Android 13+, requesting the WRITE_EXTERNAL_STORAGE permission
immediately denies, without asking the user. The @react-native-camera-roll/camera-roll
plugin being used already supports using scoped storage for saving
images on Android 13+, so this commit skips the permission check in that
case, since no permissions are needed.
Copy link

vercel bot commented Feb 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2024 10:33am

@mrousavy
Copy link
Owner

mrousavy commented Feb 7, 2024

Awesome, nice catch thank you!

@mrousavy mrousavy merged commit a4e241a into mrousavy:main Feb 7, 2024
4 checks passed
@Menardi Menardi deleted the fix/android-example-save-image branch February 7, 2024 11:56
isaaccolson pushed a commit to isaaccolson/deliveries-mobile that referenced this pull request Oct 30, 2024
On Android 13+, requesting the WRITE_EXTERNAL_STORAGE permission
immediately denies, without asking the user. The @react-native-camera-roll/camera-roll
plugin being used already supports using scoped storage for saving
images on Android 13+, so this commit skips the permission check in that
case, since no permissions are needed.
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