You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue with RNBackgroundDownloader.directories.documents on Android:
When logging RNBackgroundDownloader.directories.documents, I get /storage/emulated/0/Android/data/<package_identifier>/files.
However, when trying to get directory info using await FileSystem.getInfoAsync(RNBackgroundDownloader.directories.documents), I receive {"exists": false, "isDirectory": false}.
In contrast, logging FileSystem.documentDirectory returns file:///data/user/0/<package_identifier>/files/, and this directory does exist.
Is this behavior known or expected, or am I missing something?
On iOS, the output of both RNBackgroundDownloader.directories.documents and FileSystem.documentDirectoryare identical.
Does this mean that we cannot rely on RNBackgroundDownloader.directories.documents on Android?
Any insights or suggestions would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered:
import * as FileSystem from 'expo-file-system';
const downloadPath = FileSystem.documentDirectory
As this approach returns the existing directory for both ios and android, I think you can achieve the same with other filesystem libraries for React Native.
I haven't tested this extensively yet, so I can't guarantee that it's the ultimate solution. But this is what I have for the moment
P.S. Still very curious about the RNBackgroundDownloader.directories.documents issue that I am seeing. And wonder what users of this package are using for download directories on Android. Perhaps @kesha-antonov could shed some light
Yap bumped into the same exact issue, iOS works great with RNBackgroundDownloader.directories.documents but not in Android, so ended up using FileSystem.documentDirectory for both.
Hi there,
I've encountered an issue with RNBackgroundDownloader.directories.documents on Android:
RNBackgroundDownloader.directories.documents
, I get/storage/emulated/0/Android/data/<package_identifier>/files
.await FileSystem.getInfoAsync(RNBackgroundDownloader.directories.documents)
, I receive{"exists": false, "isDirectory": false}
.FileSystem.documentDirectory
returnsfile:///data/user/0/<package_identifier>/files/
, and this directory does exist.On iOS, the output of both
RNBackgroundDownloader.directories.documents
andFileSystem.documentDirectory
are identical.Does this mean that we cannot rely on
RNBackgroundDownloader.directories.documents
on Android?Any insights or suggestions would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: