0

My iOS app sometimes displays a Greystripe fullscreen ad on startup. If this ad shows, then when I dismiss it, later I will tap a textfield in a UIWebView but the keyboard won't show up. However, if the Greystripe ad DOESN'T appear, then all is well and the keyboard will show up as expected.

After doing some research I think it has something to do with Greystripe making itself the first responder, but I'm not sure how to fix this.

Edit: I use adwhirl and so to get the startup ad I do exactly as it says here: http://wiki.greystripe.com/index.php/AdWhirl

The UIWebView is inside another controller that is presented with presentModalViewController:animated: from the main view.

I narrowed the problem down: the problem is caused after initiating Greystripe, which occurs either from the full screen startup ad that I initiate manually or from AdWhirl automatically initiating it to display a 320x50 Greystripe banner.

user1221973
  • 21
  • 1
  • 4
  • If you explain your proposed view hierarchy, we might be able to figure out what is going on. I suspect you add your ad to a certain subview of your `UIWindow` (The one the keyboard is using) Additionally, you could just post the code you use to implement your advert. – fscheidl Feb 20 '12 at 20:54
  • The Greystripe ad is called via `[GSAdEngine displayFullScreenAdForSlotNamed:@"gsFullScreen"]`, but the problem also occurs if Adwhirl initiates Greystripe when showing a Greystripe banner ad (see my edits above). – user1221973 Feb 21 '12 at 02:58

1 Answers1

1

After hours of debugging I finally figured it out. I use SVProgressHUD to show loading status while my UIWebView is loading. SVProgressHUD.m makes itself the key window, then when it is dismissed, it returns the key window status to the "topmost" window. For some reason Greystripe, unlike all the other ad networks I'm using, makes itself the topmost window. So the problem could be Greystripe making itself too important, or SVProgressHUD miscalculating the topmost window!

To solve this, I had to manually make my view controller which contains my UIWebView the key window every time after dismissing SVProgressHUD:

[SVProgressHUD dismiss];
[self.view.window makeKeyWindow];
user1221973
  • 21
  • 1
  • 4