SOLVED: I had to remove the call to enable ad display
because it interfered with my self-created banner.
Ok, so after testing on the simulators it turns out that this issue is only occurring on actual devices... How would I fix this?
______________________________________________________________
Hello
So I'm developing an iOS app and am implementing iAD. Everything works like it should, except whenever I close a full screen ad (after opening it by clicking on the banner) the screen freezes... The app is still running because if I click the banner and close out of it again the screen refreshes like normal and I can see that that the game progressed. I have no clue what could be causing this... Here is the code I have to initialize the banner ad and the methods for it (all in the Ad Delegate within my view controller). I am using the Spritekit framework btw.
The initialization:
Now the methods:
Any help would be very much appreciated!
Thanks in advance,
StrongJoshua
Code:
self.canDisplayBannerAds
Ok, so after testing on the simulators it turns out that this issue is only occurring on actual devices... How would I fix this?
______________________________________________________________
Hello
So I'm developing an iOS app and am implementing iAD. Everything works like it should, except whenever I close a full screen ad (after opening it by clicking on the banner) the screen freezes... The app is still running because if I click the banner and close out of it again the screen refreshes like normal and I can see that that the game progressed. I have no clue what could be causing this... Here is the code I have to initialize the banner ad and the methods for it (all in the Ad Delegate within my view controller). I am using the Spritekit framework btw.
The initialization:
Code:
self.canDisplayBannerAds = YES;
CGRect bannerFrame = CGRectMake(0, 20, scene.size.width, 50);
banner = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner];
banner.delegate = self;
banner.frame = bannerFrame;
[banner setAlpha:0];
[self.view addSubview:banner];
Code:
- (void) bannerViewDidLoadAd:(ADBannerView *) bannerM
{
NSLog(@"Ad Loaded");
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[bannerM setAlpha:1];
[UIView commitAnimations];
}
- (void) bannerView:(ADBannerView *)bannerM didFailToReceiveAdWithError:(NSError *)error
{
NSLog(@"Ad Failed");
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[bannerM setAlpha:0];
[UIView commitAnimations];
}
- (BOOL) bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
{
if(playing)
{
NSLog(@"Ad Pause");
[((WBPlayScene *)((SKView *)self.originalContentView).scene).logic pause:YES];
}
return YES;
}
- (void) bannerViewActionDidFinish:(ADBannerView *)banner
{
if(playing)
{
NSLog(@"Ad Unpause");
[((WBPlayScene *)((SKView *)self.originalContentView).scene).logic pause:NO];
}
}
Thanks in advance,
StrongJoshua
Last edited: