diff --git a/CHANGELOG.md b/CHANGELOG.md index e1669d3f9..538dd69bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The changelog for `SuperwallKit`. Also see the [releases](https://github.com/sup - Fixes the SDK getting stuck in test mode when a sheet such as the Customer Center is already open as it finishes loading. - Stops matching installs for attribution unless the Superwall MMP is turned on for your app. - Fixes paywalls on first launch missing acquisition attributes in their audience filters: they now wait up to 2 seconds for install attribution to finish. +- Fixes the test mode sheet not showing in apps with more than one scene or window. ## 4.17.0 diff --git a/Sources/SuperwallKit/Config/ConfigManager.swift b/Sources/SuperwallKit/Config/ConfigManager.swift index 8c71f0a7e..354f3bf27 100644 --- a/Sources/SuperwallKit/Config/ConfigManager.swift +++ b/Sources/SuperwallKit/Config/ConfigManager.swift @@ -826,10 +826,7 @@ class ConfigManager { @MainActor private func presentTestModeModal(reason: TestModeReason, config: Config) async { - guard - let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, - let rootVC = windowScene.windows.first?.rootViewController - else { + guard let rootVC = UIApplication.sharedApplication?.activeWindow?.rootViewController else { return }