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

Commit 21fd76c

Browse files
committed
Add main bundle folder constant #138
1 parent 2b23235 commit 21fd76c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static public Map<String, Object> getSystemfolders(ReactApplicationContext ctx)
194194
try {
195195
p = m.getPackageInfo(s, 0);
196196
s = p.applicationInfo.dataDir;
197-
res.put("DocumentDir", s);
197+
res.put("MainBundleDir", s);
198198
} catch (PackageManager.NameNotFoundException e) {
199199
e.printStackTrace();
200200
}

src/ios/RNFetchBlobFS.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
@property (nonatomic) BOOL appendData;
4040

4141
// get dirs
42+
+ (NSString *) getMainBundleDir;
4243
+ (NSString *) getTempPath;
4344
+ (NSString *) getCacheDir;
4445
+ (NSString *) getDocumentDir;

src/ios/RNFetchBlobFS.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ + (NSString *) getPictureDir {
111111

112112
+ (NSString *) getTempPath {
113113

114-
return [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingString:@"/RNFetchBlob_tmp"];
114+
return NSTemporaryDirectory();
115115
}
116116

117117
+ (NSString *) getTempPath:(NSString*)taskId withExtension:(NSString *)ext {

0 commit comments

Comments
 (0)