Fix feels://subscribe deep link on cold launch via app.open()
When XCUITest calls app.open(url), the app relaunches (cold launch) and onOpenURL doesn't fire reliably. Capture the URL from launch options in AppDelegate and check it on appear with a short delay to ensure the view hierarchy is ready for sheet presentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,11 +11,16 @@ import UIKit
|
||||
import SwiftUI
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
static var pendingDeepLinkURL: URL?
|
||||
|
||||
private let savedOnboardingData = UserDefaultsStore.getOnboarding()
|
||||
@AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
|
||||
|
||||
@MainActor
|
||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
if let url = launchOptions?[.url] as? URL {
|
||||
AppDelegate.pendingDeepLinkURL = url
|
||||
}
|
||||
DataController.shared.removeNoForDates()
|
||||
DataController.shared.fillInMissingDates()
|
||||
UNUserNotificationCenter.current().delegate = self
|
||||
|
||||
Reference in New Issue
Block a user