Skip to content

Commit e06c466

Browse files
committed
Fixed fat build since adding scene support
* Scenes where not introduced until Xcode 11 * Preprocessor was not an option as we need to make a fat binary that is build with Xcode 10 no matter which Xcode version the consumer uses. This is so the bitcode version works for Xcode 10 and up.
1 parent 7dd9b5f commit e06c466

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

iOS_SDK/OneSignalSDK/Source/OSMessagingController.m

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,21 @@ - (void)webViewContentFinishedLoading {
655655
self.window.opaque = true;
656656
self.window.clipsToBounds = true;
657657

658+
[self addKeySceneToWindow:self.window];
659+
660+
[self.window makeKeyAndVisible];
661+
}
662+
663+
// Required to display if the app is using a Scene
664+
// See https://github.com/OneSignal/OneSignal-iOS-SDK/issues/648
665+
- (void)addKeySceneToWindow:(UIWindow*)window {
658666
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;
667+
// The below lines can be replace with this single line once Xcode 10 support is dropped
668+
// window.windowScene = UIApplication.sharedApplication.keyWindow.windowScene;
669+
UIWindow *keyWindow = UIApplication.sharedApplication.keyWindow;
670+
id windowScene = [keyWindow performSelector:@selector(windowScene)];
671+
[window performSelector:@selector(setWindowScene:) withObject:windowScene];
662672
}
663-
[self.window makeKeyAndVisible];
664673
}
665674

666675
#pragma mark OSTriggerControllerDelegate Methods

0 commit comments

Comments
 (0)