Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# dependencies
node_modules/
package-lock.json
yarn.lock

# Expo
.expo/
Expand All @@ -12,6 +10,8 @@ web-build/
expo-env.d.ts

# Native
/ios/
/android/
*.orig.*
*.jks
*.p8
Expand Down
39 changes: 2 additions & 37 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useEffect } from 'react';
import React from 'react';
import { StatusBar } from 'expo-status-bar';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { AppState, AppStateStatus } from 'react-native';
import { SleepProvider } from './src/context/SleepContext';
import { ThemeProvider, useTheme } from './src/context/ThemeContext';
import AppNavigator from './src/navigation/AppNavigator';
import BackgroundActivityService from './src/services/BackgroundActivityService';
import ErrorBoundary from './src/components/ErrorBoundary';

const AppContent = () => {
Expand All @@ -19,39 +17,6 @@ const AppContent = () => {
};

export default function App() {
useEffect(() => {
// Handle app state changes to prevent crashes on force close
const handleAppStateChange = async (nextAppState: AppStateStatus) => {
console.log(`🔄 App state changed to: ${nextAppState}`);

if (nextAppState === 'background' || nextAppState === 'inactive') {
try {
// Gracefully handle app going to background
console.log('📱 App going to background - preparing cleanup');
} catch (error) {
console.error('❌ Error handling app background state:', error);
}
}
};

// Subscribe to app state changes
const subscription = AppState.addEventListener('change', handleAppStateChange);

// Cleanup function to prevent memory leaks
return () => {
console.log('🧹 Cleaning up app state subscription');
subscription?.remove();

// Emergency cleanup for background service
try {
const backgroundService = BackgroundActivityService.getInstance();
backgroundService.stopMonitoring().catch(console.error);
} catch (error) {
console.error('❌ Emergency cleanup error:', error);
}
};
}, []);

return (
<ErrorBoundary>
<SafeAreaProvider>
Expand All @@ -63,4 +28,4 @@ export default function App() {
</SafeAreaProvider>
</ErrorBoundary>
);
}
}
62 changes: 62 additions & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Sleep Detector Privacy Policy

**Effective date:** August 14, 2026

Sleep Detector ("the app") is provided by SimpliXio Pte. Ltd. This policy explains how the app handles information.

## Summary

Sleep Detector is private by design. It does not require an account and does not include advertising, analytics, cross-app tracking, or a developer-operated cloud service for sleep and wellness data. Sleep records and settings are stored on the device unless the user explicitly exports them or enables Apple Health sync.

## Information handled by the app

The app can store the following information locally:

- app activity timestamps used to estimate an inactivity interval;
- sleep estimates, confirmed sleep periods, confidence details, and edits;
- optional wellness check-ins, settings, and notification preferences; and
- optional Apple Health information described below.

This information is used only to provide the app's sleep-review, history, export, and wellness features.

## Apple Health and Apple Watch

Apple Health access is optional and requested only after the user enables Health integration. With permission, the app can read sleep stages and selected recovery signals, including heart rate variability, resting heart rate, respiratory rate, and wrist temperature, to provide private sleep context. When Health sync is enabled, the app writes only sleep periods the user has confirmed.

Health information is not used for advertising, sold, shared with data brokers, or transmitted to a developer-operated server. Apple Health permissions can be changed at any time in the Health or Settings app.

The Apple Watch companion reads permitted Apple Health information only when the user requests a refresh. It does not run a continuous workout or always-on sensor session.

## Notifications

If the user grants notification permission, the app can schedule local bedtime reminders and confirmed-sleep summaries. Notification preferences can be changed in the app or in iOS Settings.

## Export and sharing

JSON and CSV exports are created only when the user requests them. The user chooses where an exported file is shared. The selected destination's privacy policy applies after the file leaves the app.

## Data retention and deletion

Sleep Detector keeps app data on the device until the user clears it in the app or uninstalls the app. Information previously written to Apple Health is controlled through the Health app and is not removed automatically when Sleep Detector is uninstalled.

## Security

The app relies on iOS device protections and HealthKit authorization controls. No method of storage is completely risk-free, so users should keep their device and Apple ID secure.

## Children

Sleep Detector is a general wellness tool and is not directed to children under 13. The app does not knowingly collect children's personal information.

## Health disclaimer

Sleep Detector supports personal awareness and journaling. It is not a medical device and does not diagnose, treat, cure, or prevent any disease or sleep disorder. Users should consult a qualified healthcare professional for medical concerns.

## Changes

This policy may be updated when the app or legal requirements change. The effective date above identifies the latest revision.

## Contact

For privacy questions, contact [[email protected]](mailto:[email protected]).

Product creator: [Pierre-Henry Soria](https://pierrehenry.dev).
16 changes: 0 additions & 16 deletions android/.gitignore

This file was deleted.

177 changes: 0 additions & 177 deletions android/app/build.gradle

This file was deleted.

Binary file removed android/app/debug.keystore
Binary file not shown.
14 changes: 0 additions & 14 deletions android/app/proguard-rules.pro

This file was deleted.

7 changes: 0 additions & 7 deletions android/app/src/debug/AndroidManifest.xml

This file was deleted.

Loading
Loading