Improve subscription UI and fix trial date handling
Lock Screen: - Add light/dark mode support with adaptive colors - Make passcode text tappable to trigger authentication Trial Date Fixes: - Fix IAPManager to read firstLaunchDate directly from UserDefaults - Add expiration date check (> Date()) before showing "expires in" text - Show "Trial expired" when trial end date is in the past - Disable subscription bypass in DEBUG mode for testing Month/Year Subscribe Prompts: - Redesign with gradient icons and compelling copy - Add fade mask (100% at top to 0% at 50%) for content behind - Position subscribe overlay on bottom half of screen - Month: purple/pink theme with calendar icon - Year: orange/pink theme with chart icon 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,8 +33,9 @@ class IAPManager: ObservableObject {
|
||||
// MARK: - Debug Toggle
|
||||
|
||||
/// Set to `true` to bypass all subscription checks and grant full access (for development only)
|
||||
/// Set to `false` to test trial/subscription behavior in DEBUG builds
|
||||
#if DEBUG
|
||||
static let bypassSubscription = true
|
||||
static let bypassSubscription = false
|
||||
#else
|
||||
static let bypassSubscription = false
|
||||
#endif
|
||||
@@ -59,8 +60,16 @@ class IAPManager: ObservableObject {
|
||||
|
||||
// MARK: - Storage
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.firstLaunchDate.rawValue, store: GroupUserDefaults.groupDefaults)
|
||||
private var firstLaunchDate = Date()
|
||||
/// Reads firstLaunchDate directly from UserDefaults to ensure we always get the latest value
|
||||
/// (Using @AppStorage in a class doesn't auto-sync when other components update the same key)
|
||||
private var firstLaunchDate: Date {
|
||||
get {
|
||||
GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.firstLaunchDate.rawValue) as? Date ?? Date()
|
||||
}
|
||||
set {
|
||||
GroupUserDefaults.groupDefaults.set(newValue, forKey: UserDefaultsStore.Keys.firstLaunchDate.rawValue)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
|
||||
Reference in New Issue
Block a user