import { Platform } from 'react-native'; import NativeSettingsModule from '../codegen/NativeSettingsModule'; interface SettingsModuleInterface { /** * Initialize device UID if not exists * Returns the device UID or "Disabled" if Do Not Track is enabled */ initializeDeviceUID(): Promise; /** * Get the device UID * Returns the device UID or "Disabled" if Do Not Track is enabled */ getDeviceUID(): Promise; /** * Get the device UID copy (for Settings display) */ getDeviceUIDCopy(): Promise; /** * Set the clearFilesOnLaunch preference */ setClearFilesOnLaunch(value: boolean): Promise; /** * Get the clearFilesOnLaunch preference */ getClearFilesOnLaunch(): Promise; /** * Set Do Not Track setting */ setDoNotTrack(enabled: boolean): Promise; /** * Get Do Not Track setting */ getDoNotTrack(): Promise; /** * Open the settings activity (Android only) * This opens the app's settings screen */ openSettings(): Promise; } // Only available on Android const nativeModule = NativeSettingsModule ?? null; const SettingsModule: SettingsModuleInterface | null = Platform.OS === 'android' ? nativeModule : null; export default SettingsModule;