mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-02-28 23:10:29 +00:00
Fixes
This commit is contained in:
parent
7bf7c0bca1
commit
bdeda5ef36
@ -196,7 +196,7 @@ var RNFS = {
|
||||
CachesDirectoryPath: RNFSManager.NSCachesDirectoryPath,
|
||||
DocumentDirectoryPath: RNFSManager.NSDocumentDirectoryPath,
|
||||
ExternalDirectoryPath: RNFSManager.NSExternalDirectoryPath,
|
||||
TemporaryDirectoryPathIOS: RNFSManager.NSTemporaryDirectoryPath,
|
||||
TemporaryDirectoryPath: RNFSManager.NSTemporaryDirectoryPath,
|
||||
LibraryDirectoryPath: RNFSManager.NSLibraryDirectoryPath,
|
||||
PicturesDirectoryPath: RNFSManager.NSPicturesDirectoryPath
|
||||
};
|
||||
|
@ -185,7 +185,8 @@ The following constants are available on the `RNFS` export:
|
||||
|
||||
`MainBundlePath` (`String`) The absolute path to the main bundle directory
|
||||
`CachesDirectoryPath` (`String`) The absolute path to the caches directory
|
||||
`DocumentDirectoryPath` (`String`) The absolute path to the document directory
|
||||
`DocumentDirectoryPath` (`String`) The absolute path to the document directory
|
||||
`TemporaryDirectoryPath` (`String`) The absolute path to the temporary directory (iOS only)
|
||||
`ExternalDirectoryPath` (`String`) The absolute path to the external, shared directory (android only)
|
||||
|
||||
### `promise readDir(path)`
|
||||
|
@ -41,6 +41,7 @@ public class RNFSManager extends ReactContextBaseJavaModule {
|
||||
private static final String NSDocumentDirectoryPath = "NSDocumentDirectoryPath";
|
||||
private static final String NSExternalDirectoryPath = "NSExternalDirectoryPath";
|
||||
private static final String NSPicturesDirectoryPath = "NSPicturesDirectoryPath";
|
||||
private static final String NSTemporaryDirectoryPath = "NSTemporaryDirectoryPath";
|
||||
private static final String NSCachesDirectoryPath = "NSCachesDirectoryPath";
|
||||
private static final String NSDocumentDirectory = "NSDocumentDirectory";
|
||||
|
||||
@ -332,6 +333,7 @@ public class RNFSManager extends ReactContextBaseJavaModule {
|
||||
final Map<String, Object> constants = new HashMap<>();
|
||||
constants.put(NSDocumentDirectory, 0);
|
||||
constants.put(NSDocumentDirectoryPath, this.getReactApplicationContext().getFilesDir().getAbsolutePath());
|
||||
constants.put(NSTemporaryDirectoryPath, null)
|
||||
File externalDirectory = this.getReactApplicationContext().getExternalFilesDir(null);
|
||||
if (externalDirectory != null) {
|
||||
constants.put(NSExternalDirectoryPath, externalDirectory.getAbsolutePath());
|
||||
|
Loading…
x
Reference in New Issue
Block a user