Skip to content

Commit acf4aa5

Browse files
blankgbcpclone
authored andcommitted
Add support for SDCards applications's directory (Android only) (wkh237#372)
1 parent f17783b commit acf4aa5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ static public Map<String, Object> getSystemfolders(ReactApplicationContext ctx)
203203
state = Environment.getExternalStorageState();
204204
if (state.equals(Environment.MEDIA_MOUNTED)) {
205205
res.put("SDCardDir", Environment.getExternalStorageDirectory().getAbsolutePath());
206+
res.put("SDCardApplicationDir", ctx.getExternalFilesDir(null).getParentFile().getAbsolutePath());
206207
}
207208
res.put("MainBundleDir", ctx.getApplicationInfo().dataDir);
208209
return res;

fs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const dirs = {
2929
DownloadDir : RNFetchBlob.DownloadDir,
3030
DCIMDir : RNFetchBlob.DCIMDir,
3131
SDCardDir : RNFetchBlob.SDCardDir,
32-
MainBundleDir : RNFetchBlob.MainBundleDir
32+
SDCardApplicationDir : RNFetchBlob.SDCardApplicationDir,
33+
MainBundleDir : RNFetchBlob.MainBundleDir,
34+
LibraryDir : RNFetchBlob.LibraryDir
3335
}
3436

3537
/**

0 commit comments

Comments
 (0)