2

I have Updated to new Version of Applovin SDK (6.12.2) in IOS. Applovin have the same delegate for All type of ads, and currently the code i am using to identify the ads are deprecated.

- (void)adService:(ALAdService *)adService didLoadAd:(ALAd *)ad
{
 if ([ad.size.label  isEqual: @"INTER"]) \\ad.size.label is deprecated
    {
        if ([ad.type.label isEqual:@"VIDEOA"])
        {
 NSLog(@"ADS Applovin reward video Cached");
}
        else  if ([ad.type.label isEqual:@"REGULAR"])
        {
 NSLog(@"ADS Applovin Interstitial Cached");
        }
 }
    else if ([ad.size.label  isEqual: @"LEADER"]) {
 }
    else if ([ad.size.label  isEqual: @"BANNER"]) {
}

ad.size.label is deprecated so is there any new way to get the ads type?

Hardik Mistry
  • 25
  • 1
  • 4

2 Answers2

1

This should help:

to detect regular interstitials:

if ( ad.size == ALAdSize.interstitial && ad.type == ALAdType.regular )

to detect rewarded ads:

if ( ad.size == ALAdSize.interstitial && ad.type == ALAdType.incentivized )

to detect banner ads:

if ( ad.size == ALAdSize.banner )
Thomas Elliot
  • 659
  • 8
  • 12
  • Thanks , This is correct. I also found out about this conditions after checking in Applovin framework classes but i forgot to update the Question. Thanks for the answer. – Hardik Mistry Apr 15 '21 at 11:35
0

you probably will want to create a listener class to implement these delegate methods. if you want different logic for each ad size you could have a bannerDelegate, interstitialDelegate, and rewardedDelegate class for example. each class could encapsulate the logic for that ad type.

josh
  • 51
  • 4