How to load AdMob mediation adapters

I try to use AdMob Mediation on iOS. I added the following lines to my Podfile:

pod 'Google-Mobile-Ads-SDK'
pod 'GoogleMobileAdsMediationAppLovin'
pod 'GoogleMobileAdsMediationInMobi'

I use the following code to init the AdMob:

 -(void)initAds
 {
    [[GADMobileAds sharedInstance] startWithCompletionHandler:^(GADInitializationStatus *_Nonnull status) {

        NSLog(@"Ad setup completed");

        NSLog(@"AdMob SDK version: %@", [GADRequest sdkVersion]);
        NSLog(@"AppLovin SDK version: %@", [ALSdk version]);
        NSLog(@"InMobi SDK version: %@", [IMSdk getVersion]);

        NSDictionary<NSString *, GADAdapterStatus *>* states = [status adapterStatusesByClassName];
        for(id key in states) {
            GADAdapterStatus * adapterStatus = [states objectForKey:key];
            NSString* state = @"not ready";
            if (adapterStatus.state == GADAdapterInitializationStateReady) state = @"ready";
            double latency = adapterStatus.latency;

            NSLog(@"%@ : %@ : %f sec", key, state, latency);
        }


        [self createBannerView];
        [self createInterstitialView];
    }];
 }

If I start the app I get the following output:

App[75041:5379032] AdMob SDK version: afma-sdk-i-v7.52.0
App[75041:5379032] AppLovin SDK version: 6.9.5
App[75041:5379032] InMobi SDK version: 7.4.0
App[75041:5379032] com.google.ads.mediation.inmobi.InMobiMediationAdapter : not ready : 0.000000 sec
App[75041:5379032] com.google.ads.mediation.applovin.AppLovinMediationAdapter : not ready : 0.000000 sec
App[75041:5379032] GADMobileAds : ready : 0.000699 sec

On the linker output I can see that the adapters are linked. How can I fix this? The GoogleMobileAdsMediationTestSuite also think the AdMob adapter is missing, but I get ads from AdMob.

1 answer

  • answered 2019-11-13 19:11 Mr.Betatester

    I got it. I used the Android App Id in the info.plist instead the iOS App Id.