Skip to content

Commit d91c23d

Browse files
committed
Fix IAM crash on dismiss for SwiftUI projects
1 parent fc2d635 commit d91c23d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

iOS_SDK/OneSignalSDK/Source/OSMessagingController.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,12 @@ - (void)evaluateMessageDisplayQueue {
475475
}
476476

477477
/*
478-
Hide the window and call makeKeyWindow to ensure the IAM will not be shown
479-
*/
478+
Hide the top level IAM window
479+
After the IAM window is hidden, iOS will automatically promote the main window
480+
This also re-shows the keyboard automatically if it had focus in a text input
481+
*/
480482
- (void)hideWindow {
481483
self.window.hidden = true;
482-
[UIApplication.sharedApplication.delegate.window makeKeyWindow];
483484
}
484485

485486
- (void)persistInAppMessageForRedisplay:(OSInAppMessage *)message {

0 commit comments

Comments
 (0)