iosobjective-ccocos2d-xadsapplovin

Applovin identifying Ads type (IOS , objective C)


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?


Solution

  • 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 )