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

getPhotos doesn't work if you use compileSdkVersion 33 #2022

Closed
aharwood9 opened this issue Mar 21, 2023 · 3 comments · Fixed by #2036
Closed

getPhotos doesn't work if you use compileSdkVersion 33 #2022

aharwood9 opened this issue Mar 21, 2023 · 3 comments · Fixed by #2036
Assignees
Labels
Bug Something isn't working in the SDK released

Comments

@aharwood9
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

getPhotos on Android uses the PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE and will throw an error if this isn't granted. We had to update our app to use compileSdkVersion 33 which means getPhotos no longer works as READ_EXTERNAL_STORAGE no longer has an impact.

Here is a link from the Android docs -

Note: Starting in API level 33, this permission has no effect. If your app accesses other apps' media files, request one or more of these permissions instead: [READ_MEDIA_IMAGES](https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_IMAGES), [READ_MEDIA_VIDEO](https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_VIDEO), [READ_MEDIA_AUDIO](https://developer.android.com/reference/android/Manifest.permission#READ_MEDIA_AUDIO).

Dev environment info (please complete/provide the following information):

  • Package version (stream-chat-react-native/stream-chat-expo) - stream-chat-react-native
  • react-native or expo version - 5.11.2
  • Device/Emulator (android/ios) and OS version - Android 13 only (I think), Pixel 5 (only tested on this)

To Reproduce
Steps to reproduce the behavior:

  1. Update build.gradle to use compileSdkVersion 33 within SampleApp
  2. Boot Sample App on Android 13 device
  3. Try to attach a photo
  4. See Error or blank modal

Expected behavior
A clear and concise description of what you expected to happen.

Repeat above but see photos from camerroll

Additional context
Add any other context about the problem here.

Screenshots
If applicable, add screenshots to help explain your problem.

@santhoshvai santhoshvai self-assigned this Mar 21, 2023
@santhoshvai santhoshvai added Bug Something isn't working in the SDK and removed Needs Triaging labels Mar 21, 2023
@santhoshvai
Copy link
Member

santhoshvai commented Mar 21, 2023

@aharwood9 There is no api to get the target SDK on runtime... So we are going to make it so that if react native 0.71 version is used then to use the new permissions..

Just to be clear, you are using RN v0.71 right?

@aharwood9
Copy link
Contributor Author

That sounds great @santhoshvai 🎉 merci for the quick response

@stream-ci-bot
Copy link
Contributor

🎉 This issue has been resolved in version 5.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working in the SDK released
Projects
None yet
3 participants