Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiding whisper breaks when used with other UIWindows (such as GoogleMobileAds). #156

Closed
barnaclejive opened this issue May 8, 2017 · 1 comment

Comments

@barnaclejive
Copy link

I found that Whisper's hide() function ends up displaying the wrong UIWindow when other UIWindows exists that are not that main app. Such as when GoogleMobileAds is configured. Whisper expects the first non-whistleWindow to be the main app, but that is no longer true because GoogleMobileAds is tossing in it's own special UIWindow(s). I assume this may be an issue with other third-party code that adds additional UIWindow object(s) to the app. Is this a known issue?

if let window = UIApplication.shared.windows.filter({ $0 != self.whistleWindow }).first {
          window.makeKeyAndVisible()
          self.whistleWindow.windowLevel = UIWindowLevelNormal - 1
          window.rootViewController?.setNeedsStatusBarAppearanceUpdate()
        }

It seems that configuring GoogleMobileAds adds an extra UIWindow object to the app where it hangs on to ads (or something), see screenshot. This creates a situation where upon a whisper hiding itself, a blank black UIWindow obscures the app.

This Google UIWindow seems to be automatically injected into the app. The only code I needed to replicate it is this in AppDelegate:

pod 'Firebase/Core'
pod 'Firebase/AdMob'
import GoogleMobileAds

and in didFinishLaunchingWithOptions

GADMobileAds.configure(withApplicationID: "foo");

ss

@barnaclejive
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant