Przeglądaj źródła

Add support for SDCards applications's directory (Android only) (#372)

Guy Blank 7 lat temu
rodzic
commit
acf4aa5578

+ 1
- 0
android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java Wyświetl plik

@@ -203,6 +203,7 @@ public class RNFetchBlobFS {
203 203
         state = Environment.getExternalStorageState();
204 204
         if (state.equals(Environment.MEDIA_MOUNTED)) {
205 205
             res.put("SDCardDir", Environment.getExternalStorageDirectory().getAbsolutePath());
206
+            res.put("SDCardApplicationDir", ctx.getExternalFilesDir(null).getParentFile().getAbsolutePath());
206 207
         }
207 208
         res.put("MainBundleDir", ctx.getApplicationInfo().dataDir);
208 209
         return res;

+ 3
- 1
fs.js Wyświetl plik

@@ -29,7 +29,9 @@ const dirs = {
29 29
     DownloadDir : RNFetchBlob.DownloadDir,
30 30
     DCIMDir : RNFetchBlob.DCIMDir,
31 31
     SDCardDir : RNFetchBlob.SDCardDir,
32
-    MainBundleDir : RNFetchBlob.MainBundleDir
32
+    SDCardApplicationDir : RNFetchBlob.SDCardApplicationDir,
33
+    MainBundleDir : RNFetchBlob.MainBundleDir,
34
+    LibraryDir : RNFetchBlob.LibraryDir
33 35
 }
34 36
 
35 37
 /**