Suntime Alerts is a dual-native mobile app (iOS + Android) that schedules alarms relative to daily sunrise and sunset times. The repo houses two independent projects that share the same domain concepts and scheduling principles, keeping platform implementations idiomatic while ensuring consistent behaviour.
README.md: Overview and quickstart for both platforms.DESIGN.md: Architecture and product design reference.ios/: Native Swift/SwiftUI app using MVVM and clean layering.android/: Native Kotlin/Jetpack Compose app using MVVM, coroutines, and WorkManager/AlarmManager..github/workflows/: Continuous integration skeletons.
- Swift 5+, SwiftUI UI layer, MVVM + clean separation (Domain/Data/Presentation/Services).
- CoreLocation for location, UserNotifications for alarms, UserDefaults-based settings store.
- Async/await for async flows.
- Kotlin with Jetpack Compose and Navigation.
- Coroutines + Flow, ViewModel, DataStore for settings, Fused Location Provider for location.
- WorkManager for daily recomputation, AlarmManager + NotificationCompat for delivery.
- Open
ios/SuntimeAlerts.xcodeprojin Xcode (project scaffolded for SwiftUI). - Build and run on iOS 16+ simulator or device.
- Grant location and notification permissions during onboarding.
- Open
android/in Android Studio Giraffe+. - Sync Gradle to download dependencies.
- Run the
appconfiguration on an API 24+ emulator or device. - If the Gradle wrapper JAR is missing (some CI environments omit it), regenerate with
./gradlew wrapper --gradle-version 8.2.1.
- Shared domain concepts:
SunEventType,SunEvent,SunAlarmConfig,UserSettings. - Pure, on-device
SunTimesCalculator(NOAA-inspired solar position math) for offline correctness. - Daily recomputation and rescheduling reacting to time zone, DST, and location changes.
- Testable core logic with unit tests for solar calculations and scheduling offsets on both platforms.
Use these commands to confirm that the system AlarmManager state matches in-app alarm toggles:
- Clear app state (optional):
adb shell pm clear com.bfalls.suntimealerts - Inspect future alarms (should be empty after disabling/deleting all alarms):
PKG=com.bfalls.suntimealerts adb shell dumpsys alarm | grep "$PKG" | grep "OW=" | sed -n 's/.*OW=\([0-9-]* [0-9:]*\).*/\1 &/p' | awk -v now="$(adb shell date '+%Y-%m-%d %H:%M:%S')" '$1 " " $2 > now'
- Trigger a manual reconcile if needed (debug-only broadcast):
adb shell am broadcast -a com.bfalls.suntimealerts.DEBUG_RECONCILE_ALARMS
See DESIGN.md for detailed flows, algorithms, and extension notes.