Skip to content

Commit f1fc596

Browse files
committed
allow to get the applicationSupport path
1 parent dcbde6f commit f1fc596

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

fs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const dirs = {
2323
SDCardDir: RNFetchBlob.SDCardDir, // Depracated
2424
SDCardApplicationDir: RNFetchBlob.SDCardApplicationDir, // Deprecated
2525
MainBundleDir : RNFetchBlob.MainBundleDir,
26-
LibraryDir : RNFetchBlob.LibraryDir
26+
LibraryDir : RNFetchBlob.LibraryDir,
27+
ApplicationSupportDir: RNFetchBlob.ApplicationSupportDir
2728
}
2829

2930
function addCode(code: string, error: Error): Error {

ios/RNFetchBlob/RNFetchBlob.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ - (NSDictionary *)constantsToExport
7676
@"MovieDir" : [RNFetchBlobFS getMovieDir],
7777
@"MusicDir" : [RNFetchBlobFS getMusicDir],
7878
@"PictureDir" : [RNFetchBlobFS getPictureDir],
79+
@"ApplicationSupportDir" : [RNFetchBlobFS getApplicationSupportDir],
7980
};
8081
}
8182

ios/RNFetchBlobFS.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
+ (NSString *) getMovieDir;
5555
+ (NSString *) getMusicDir;
5656
+ (NSString *) getPictureDir;
57+
+ (NSString *) getApplicationSupportDir;
5758
+ (NSString *) getTempPath;
5859
+ (NSString *) getTempPath:(NSString*)taskId withExtension:(NSString *)ext;
5960
+ (NSString *) getPathOfAsset:(NSString *)assetURI;

ios/RNFetchBlobFS.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ + (NSString *) getPictureDir {
124124
return [NSSearchPathForDirectoriesInDomains(NSPicturesDirectory, NSUserDomainMask, YES) firstObject];
125125
}
126126

127+
+ (NSString *) getApplicationSupportDir {
128+
return [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject];
129+
}
130+
127131
+ (NSString *) getTempPath {
128132

129133
return NSTemporaryDirectory();

0 commit comments

Comments
 (0)