privateDirectory
Returns the path to the app's private document directory. This is the recommended location for storing captured photos and sensitive files.
Usage
import { privateDirectory } from '@succinctlabs/react-native-zcam1';
const privatePath = privateDirectory();
console.log('Private directory:', privatePath);Returns
string - The absolute path to the app's private document directory
Example
import { privateDirectory } from '@succinctlabs/react-native-zcam1';
import { ZImagePicker } from '@succinctlabs/react-native-zcam1';
function GalleryScreen() {
const privatePath = privateDirectory();
return (
<ZImagePicker
source={{ path: privatePath }}
onSelect={(uri) => console.log('Selected:', uri)}
/>
);
}Notes
- The private directory is app-specific and not accessible by other apps
- Files in this directory persist across app launches
- Files are automatically deleted when the app is uninstalled
- This directory is not backed up to iCloud by default
- The path is stable across app launches but may change on app reinstall