Admob for interstitial iOS video starts in the background when loading

I load the firewall ad to the controller load. When the download is complete, the ad starts automatically. The sound of the announcement is heard. Download code below:

interstitial = [[GADInterstitial alloc] initWithAdUnitID:admobInterstatialID];
GADRequest *request = [GADRequest request];
[interstitial loadRequest:request];

Display ad code below:

if ([interstitial isReady]) {
    [interstitial presentFromRootViewController:self];
}

Thanks for any help!

+4
source share
1 answer

Check the logs to see if you get an error. "Cannot create interstitial connection. This is not ready."

Below code written inside the controller load?

if ([interstitial isReady]) {
    [interstitial presentFromRootViewController:self];
}

You need to wait until the ad is fully loaded (especially for interstitial ads). Please change the code to

    - (void)interstitialDidReceiveAd:(GADInterstitial *)ad { 
if ([interstitial isReady]) {
    [interstitial presentFromRootViewController:self];
}

}

0
source

Source: https://habr.com/ru/post/1652749/


All Articles