Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit e2dae6e

Browse files
blankgwkh237
authored andcommitted
Add support for SDCards applications's directory (Android only) (#372)
1 parent 6473764 commit e2dae6e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ static public Map<String, Object> getSystemfolders(ReactApplicationContext ctx)
207207
state = Environment.getExternalStorageState();
208208
if (state.equals(Environment.MEDIA_MOUNTED)) {
209209
res.put("SDCardDir", Environment.getExternalStorageDirectory().getAbsolutePath());
210+
res.put("SDCardApplicationDir", ctx.getExternalFilesDir(null).getParentFile().getAbsolutePath());
210211
}
211212
res.put("MainBundleDir", ctx.getApplicationInfo().dataDir);
212213
return res;

fs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const dirs = {
2929
DownloadDir : RNFetchBlob.DownloadDir,
3030
DCIMDir : RNFetchBlob.DCIMDir,
3131
SDCardDir : RNFetchBlob.SDCardDir,
32+
SDCardApplicationDir : RNFetchBlob.SDCardApplicationDir,
3233
MainBundleDir : RNFetchBlob.MainBundleDir,
3334
LibraryDir : RNFetchBlob.LibraryDir
3435
}

0 commit comments

Comments
 (0)