Skip to content

Commit c1d82e2

Browse files
committed
IAMs now show for apps using Scenes / SwiftUI
* Before this change any project that updated to use the new UIScene in iOS 13 would result in the IAM not showing. - No warning or error was showing either.
1 parent f0396e5 commit c1d82e2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

iOS_SDK/OneSignalSDK/Source/OSMessagingController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,12 @@ - (void)webViewContentFinishedLoading {
654654
self.window.backgroundColor = [UIColor clearColor];
655655
self.window.opaque = true;
656656
self.window.clipsToBounds = true;
657+
658+
if (@available(iOS 13.0, *)) {
659+
// Required to display if the app is using a Scene
660+
// See https://github.com/OneSignal/OneSignal-iOS-SDK/issues/648
661+
self.window.windowScene = UIApplication.sharedApplication.keyWindow.windowScene;
662+
}
657663
[self.window makeKeyAndVisible];
658664
}
659665

0 commit comments

Comments
 (0)