I am trying to integrate AppLovin Banner Ads into my Universal App. On iPhone, it works fine. But on iPad, there is a crash of the app after the view with the banner is left/dismissed by the user.
Here is the code to show the banner ad:
// Create new AdView
adView = [[ALAdView alloc] initBannerAd];
//
// (Optional) Position the ad at the bottom of screen. By default
// it would be postitioned at (0,0)
//
adView.frame = CGRectMake( 0,
self.view.frame.size.height - adView.frame.size.height,
adView.frame.size.width,
adView.frame.size.height );
adView.autoresizingMask =
UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleRightMargin;
// (Mandatory) Add the ad into current view
[self.view addSubview:adView];
// (Mandatory) Trigger loading of the new ad.
[adView loadNextAd];
If I comment out the addSubview invocation, no crash occurs. It seems like the added subview does not get unitialized or something.
Your help is much appreciated!