I have implemented Admob in my iOS application. Banners, rewarded videos and mediated interstitials (Admob, Unity and Chartboost). The only problem I have is that the app always crash after 3-4 interstitial ads has been presented. The debugger shows this message: Message from debugger: Terminated due to memory issue
.
I am 100% sure the crash comes from the Interstitials. I have tested completely without ads, no crash. And only with banner ads, no crash.
This is the code I use to implement and show Interstitial ads:
@interface ViewController ()
@property(nonatomic, strong) GADInterstitial *interstitial;
@end
- (void)viewDidLoad {
[self loadInterstitial];
}
- (void)loadInterstitial {
self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"ca-app-pub-xxxxx/xxxxx"];
self.interstitial.delegate = self;
[self.interstitial loadRequest:[GADRequest request]];
}
- (void)interstitialDidDismissScreen:(GADInterstitial *)interstitial {
[self loadInterstitial];
}
- (void)someMethod {
if (self.interstitial.isReady) {
[self.interstitial presentFromRootViewController:self];
}
}