Reputation: 190
Hi I am working on a mobile application (react native 0.60.4
) where I am downloading file using rn-fetch-blob
to a custom path
storage/emulated/0/test
earlier it was working fine then I had to update the targetSDKVersion
to 29
and compileSDKVersion
to 29
after that it stopped working in android 10
Even after adding android:requestLegacyExternalStorage="true"
its not working..
can someone help me what could be the work around for this to work.
or any other library to use with DownloadManager
with notification
TIA
Upvotes: 2
Views: 4112
Reputation: 317
In the addAndroidDownloads
, the path should be complete.
See this answer
Upvotes: 0
Reputation: 32231
With Android 10 External storage access scoped to app files and media, you should switch for getExternalFilesDir() instead of storage/emulated/0/
.
Also, note that rn-fetch-blob
is no longer maintained since Nov 2020, so you better switch to a different download manager altogether.
Upvotes: 2
Reputation: 9282
DownloadManager on an Android 10 device wil not download to the root of external storage or to your own directory on root of external storage.
You have to choose one of the public directories on external storage like Documents, Download, DCIM and so on.
For the DownloadManager you do not need to request legacy external storage.
Upvotes: 0