interstitial_ = [[GADInterstitial alloc] init];
interstitial_.adUnitID = ....;
interstitial_.delegate = self;
GADRequest *request = [GADRequest request];
[interstitial_ loadRequest:request];
But what happens is that if the Interstitial is a video ad even tough we never call [interstitial_ presentFromRootViewController:root]; the sound starts playing in the background from the video in the Interstitial.
Any workaround for this?
GADInterstitialDelegate methods are implemented I can clearly see it receives the Ad (interstitialDidReceiveAd:) and audio starts playing in background somewhere (this time it was Cookie Jam app ad) even tough (interstitialWillPresentScreen:) is never called.
AVPlayerLayer.player.muted = true to see if that prevents the ad from taking over audio.
interstitialDidReceiveAd: Loaded ad for GADMAdapterGoogleAdMobAds
- Google/AdMob (1.0.7):
- Google/Core
- GoogleMobileAds (~> 7.3)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Below code causes interstitial autoplays in background if it contains video.
[[NSUserDefaults standardUserDefaults] registerDefaults:@{@"UserAgent" : @"Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.38 (KHTML, like Gecko) Version/10.0 Mobile/14A300 Safari/602.1"}];
return YES;
}