diff --git a/FS.common.js b/FS.common.js index 8261687..5baf5ed 100644 --- a/FS.common.js +++ b/FS.common.js @@ -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 }; diff --git a/README.md b/README.md index 941754f..51beeb8 100644 --- a/README.md +++ b/README.md @@ -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)` diff --git a/android/src/main/java/com/rnfs/RNFSManager.java b/android/src/main/java/com/rnfs/RNFSManager.java index 3682588..43800dd 100644 --- a/android/src/main/java/com/rnfs/RNFSManager.java +++ b/android/src/main/java/com/rnfs/RNFSManager.java @@ -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 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());