Skip to content

Commit 82fbf95

Browse files
committed
Add some temporary output for debugging.
1 parent 414b630 commit 82fbf95

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

GoogleSignIn/Sources/GIDEMMErrorHandler.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ - (BOOL)handleErrorFromResponse:(NSDictionary<NSString *, id> *)response
150150
- (nullable UIWindow *)keyWindow {
151151
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
152152
if (@available(iOS 15, *)) {
153+
printf("keywindow - 15\n");
153154
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
154155
if ([scene isKindOfClass:[UIWindowScene class]] &&
155156
scene.activationState == UISceneActivationStateForegroundActive) {
@@ -161,13 +162,17 @@ - (nullable UIWindow *)keyWindow {
161162
{
162163
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0
163164
if (@available(iOS 13, *)) {
165+
printf("keywindow - 13\n");
164166
for (UIWindow *window in UIApplication.sharedApplication.windows) {
167+
printf("keywindow - checking window\n");
165168
if (window.keyWindow) {
169+
printf("keywindow - window found\n");
166170
return window;
167171
}
168172
}
169173
} else {
170174
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_13_0
175+
printf("keywindow - fallback\n");
171176
return UIApplication.sharedApplication.keyWindow;
172177
#endif // __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_13_0
173178
}

GoogleSignIn/Tests/Unit/GIDEMMErrorHandlerTest.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ - (void)testKeyWindow {
493493
withBlock:^{ return mockApplication; }];
494494
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
495495
if (@available(iOS 15, *)) {
496+
printf("test - 15\n");
496497
UIWindowScene *mockWindowScene = OCMClassMock([UIWindowScene class]);
497498
OCMStub(mockApplication.connectedScenes).andReturn(@[mockWindowScene]);
498499
OCMStub(mockWindowScene.activationState).andReturn(UISceneActivationStateForegroundActive);
@@ -502,9 +503,11 @@ - (void)testKeyWindow {
502503
{
503504
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0
504505
if (@available(iOS 13, *)) {
506+
printf("test - 13\n");
505507
OCMStub(mockApplication.windows).andReturn(@[mockKeyWindow]);
506508
} else {
507509
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_13_0
510+
printf("test - fallback\n");
508511
OCMStub(mockApplication.keyWindow).andReturn(mockKeyWindow);
509512
#endif // __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_13_0
510513
}

0 commit comments

Comments
 (0)