AVAudioSession Issue iOS
XCode: All versions | Appodeal SDK: All versions
If you use video or audio sessions in your app (usually for music players), you may encounter a problem with incorrect audio playback when loading an AdMob ad.
To solve this problem, add the following method to your AppDelegate:
- Swift
- Objective C
import GoogleMobileAds
final class AppDelegate ... {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GADMobileAds.sharedInstance().audioVideoManager.audioSessionIsApplicationManaged = true
return true
}
}
#import <GoogleMobileAds/GoogleMobileAds.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
GADMobileAds.sharedInstance.audioVideoManager.audioSessionIsApplicationManaged = true;
return YES;
}
@end
You can find more information here.