I'm using Google AdMob SDK (latest one downloaded just recently) in my app.
When my app launches it freezes for 4-5 seconds, until the ad is loaded and displayed. Afterwards it runs smoothly. When I comment out the banner request line, the app starts normally.
I have made a custom helper class, in which I have the following code.
- (void) getGoogleBanner:(UIViewController *) targetController
{
self.googleBannerView.rootViewController = targetController;
[self.googleBannerView.rootViewController.view addSubview:self.googleBannerView];
[self.googleBannerView setDelegate:self];
GADRequest* request = [GADRequest request];
[self.googleBannerView loadRequest:request];
}
where
I'd like to know if anyone has run into this problem, and how it is solved. I'm open to any ideas that would remove the freezing issue. I tried to running the code to a background thread, but I failed because I'm not very experienced with it.
Any help is much appreciated, thanks in advance.
I've got the issue only when running in the simulator, so if this is the case, you shouldn't probably worry.
From what I could find, when calling the loadRequest
method, the framework will also call canOpenURL:
method (UIApplication
). From some tests that I ran (on both simulator and iOS devices with 5.1.1 and 6.1.3), canOpenURL
occasionally freezes for few seconds on the simulator (once it took it 20 seconds to return), however, works well on the devices.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With