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 public directory #90

Closed

Conversation

oneHamidreza
Copy link

@oneHamidreza oneHamidreza commented Dec 18, 2021

Changed DCIMDir, PictureDir, MusicDir, DownloadDir, MovieDir, RingtoneDir, SDCardDir to Environment.getExternalStoragePublicDirectory path.

@SabbeAndres
Copy link

This fixed my download problem, thanks!

@RonRadtke
Copy link
Owner

You'll break the fix made in this commit: ae998b2

Besides you would break Android > API 29 with this fix. So not going to merge it. Please fix it in a way that won't lead to additional problems / crashes.

@halaei
Copy link

halaei commented Dec 22, 2021

Hello @RonRadtke. It seems that there is no need to check for null, because unlike ctx.getExternalFilesDir(), Environment.getExternalStoragePublicDirectory() doesn't return null, but may return a File which doesn't exist.

I am not sure if Environment.getExternalStoragePublicDirectory() causes issue for API > 29. It is deprecated but still usable, isn't it?

My related issue: #89

@RonRadtke
Copy link
Owner

How about implementing an option like "legacypath" and this one will return the "old" version via Environment.getExternalStoragePublicDirectory() ?
That way we could make sure not not break anything and let the user decide which path he wants to use.

@afilp
Copy link

afilp commented Jan 27, 2022

Does this PR allow us to download a PDF inside the common (public) Downloads instead of the "app-specific" "Downloads"? (in Android -> data

@RonRadtke
Copy link
Owner

Not in android >= 10

@RonRadtke
Copy link
Owner

I created a branch with changes to expose the old paths: https://github.com/RonRadtke/react-native-blob-util/tree/feature/legacypaths

@oneHamidreza @halaei what's your opinion about this way? Doable for you or any better suggestions?

@RonRadtke
Copy link
Owner

@RonRadtke RonRadtke closed this Jul 2, 2022
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.

5 participants