Sfoglia il codice sorgente

Add main bundle folder constant #138

Ben Hsieh 8 anni fa
parent
commit
21fd76c8bd

+ 1
- 1
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java Vedi File

@@ -194,7 +194,7 @@ public class RNFetchBlobFS {
194 194
         try {
195 195
             p = m.getPackageInfo(s, 0);
196 196
             s = p.applicationInfo.dataDir;
197
-            res.put("DocumentDir", s);
197
+            res.put("MainBundleDir", s);
198 198
         } catch (PackageManager.NameNotFoundException e) {
199 199
             e.printStackTrace();
200 200
         }

+ 1
- 0
src/ios/RNFetchBlobFS.h Vedi File

@@ -39,6 +39,7 @@
39 39
 @property (nonatomic) BOOL appendData;
40 40
 
41 41
 // get dirs
42
++ (NSString *) getMainBundleDir;
42 43
 + (NSString *) getTempPath;
43 44
 + (NSString *) getCacheDir;
44 45
 + (NSString *) getDocumentDir;

+ 1
- 1
src/ios/RNFetchBlobFS.m Vedi File

@@ -111,7 +111,7 @@ NSMutableDictionary *fileStreams = nil;
111 111
 
112 112
 + (NSString *) getTempPath {
113 113
     
114
-    return [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingString:@"/RNFetchBlob_tmp"];
114
+    return NSTemporaryDirectory();
115 115
 }
116 116
 
117 117
 + (NSString *) getTempPath:(NSString*)taskId withExtension:(NSString *)ext {