Search code examples
iosadmobunrecognized-selectorapplovin

AppLovin init with AdMob(V7.7.1) Mediation exception in IOS 9.3 app


I have integrated AppLovin in AdMOb mediation. And followed all the steps mentioned in AppLovin docs.

When I run the application to show AppLovin videos with below code,

GADInterstitial* interstitialVideo = [[GADInterstitial alloc] initWithAdUnitID:@"ca-app-pub-xxxxxxxxxxxx"];
interstitialVideo.delegate = self;
GADRequest *request = [GADRequest request];
// Requests test ads on test devices.
request.testDevices = @[ testDeview ];
[interstitialVideo loadRequest:request];

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

I am getting below exception,

[2604:1732410] -[GADMAdapterAppLovinRewardBasedVideoAd initWithGADMAdNetworkConnector:]: unrecognized selector sent to instance 0x1283d7570
2016-04-20 16:14:32.100 [2604:1732410] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADMAdapterAppLovinRewardBasedVideoAd initWithGADMAdNetworkConnector:]: unrecognized selector sent to instance 0x1283d7570'
** First throw call stack:

I tried adding -ObjC -all_load to other linker flags but still i get same exception.

Please let me know if any one know whats wrong here.


Solution

  • Finally I fixed the issue.

    I need to use below code instead of above code(as mentioned in question)

    //Initialize

    [GADRewardBasedVideoAd sharedInstance].delegate = self;
    [[GADRewardBasedVideoAd sharedInstance] loadRequest:[GADRequest request]
                                       withAdUnitID:@"ca-app-pub-xxxxxxxxxxxx"];
    

    //To show add

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

    After above changes I started getting the AppLovin videos.

    For more details check link https://developers.google.com/admob/ios/rewarded-video#request_rewarded_video