Skip to content

Commit

Permalink
IronSource/7.4.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins committed Aug 15, 2023
1 parent f4fd8af commit 177c6b6
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 15 deletions.
2 changes: 1 addition & 1 deletion IronSource/AppLovinMediationIronSourceAdapter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|

s.authors = 'AppLovin Corporation'
s.name = 'AppLovinMediationIronSourceAdapter'
s.version = '7.4.0.0.0'
s.version = '7.4.0.0.1'
s.platform = :ios, '11.0'
s.summary = 'IronSource adapter used for mediation with the AppLovin MAX SDK'
s.homepage = "https://github.com/CocoaPods/Specs/search?o=desc&q=#{s.name}&s=indexed"
Expand Down
3 changes: 3 additions & 0 deletions IronSource/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 7.4.0.0.1
* Add support for bidding on banners/MRECs, interstitials, and rewarded ads.

## 7.4.0.0.0
* Certified with IronSource SDK 7.4.0.0.
* Updated the minimum required iOS version to 11.0 to match IronSource SDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

#import <AppLovinSDK/AppLovinSDK.h>

@interface ALIronSourceMediationAdapter : ALMediationAdapter <MAInterstitialAdapter, MARewardedAdapter, MAAdViewAdapter>
@interface ALIronSourceMediationAdapter : ALMediationAdapter <MASignalProvider, MAInterstitialAdapter, MARewardedAdapter, MAAdViewAdapter>

@end
70 changes: 57 additions & 13 deletions IronSource/IronSourceAdapter/ALIronSourceMediationAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import "ALIronSourceMediationAdapter.h"
#import <IronSource/IronSource.h>

#define ADAPTER_VERSION @"7.4.0.0.0"
#define ADAPTER_VERSION @"7.4.0.0.1"

@interface ALIronSourceMediationAdapterRouter : ALMediationAdapterRouter <ISDemandOnlyInterstitialDelegate, ISDemandOnlyRewardedVideoDelegate, ISLogDelegate>
@property (nonatomic, assign, getter=hasGrantedReward) BOOL grantedReward;
Expand Down Expand Up @@ -94,12 +94,26 @@ - (void)destroy
[self.router removeAdapter: self forPlacementIdentifier: self.routerPlacementIdentifier];
}

#pragma mark - MASignalProvider Methods

- (void)collectSignalWithParameters:(id<MASignalCollectionParameters>)parameters andNotify:(id<MASignalCollectionDelegate>)delegate
{
[self log: @"Collecting signal..."];

[self setPrivacySettingsWithParameters: parameters];

NSString *signal = [IronSource getISDemandOnlyBiddingData];
[delegate didCollectSignal: signal];
}

#pragma mark - MAInterstitialAdapter Methods

- (void)loadInterstitialAdForParameters:(id<MAAdapterResponseParameters>)parameters andNotify:(id<MAInterstitialAdapterDelegate>)delegate
{
NSString *bidResponse = parameters.bidResponse;
BOOL isBiddingAd = [bidResponse al_isValidString];
NSString *instanceID = parameters.thirdPartyAdPlacementIdentifier;
[self log: @"Loading ironSource interstitial for instance ID: %@", instanceID];
[self log: @"Loading ironSource %@interstitial for instance ID: %@", ( isBiddingAd ? @"bidding " : @"" ), instanceID];

[self updateIronSourceDelegates];
[self setPrivacySettingsWithParameters: parameters];
Expand All @@ -110,14 +124,21 @@ - (void)loadInterstitialAdForParameters:(id<MAAdapterResponseParameters>)paramet
delegate: delegate
forPlacementIdentifier: self.routerPlacementIdentifier];

if ( [IronSource hasISDemandOnlyInterstitial: instanceID] )
if ( isBiddingAd )
{
[self log: @"Ad is available already for instance ID: %@", instanceID];
[self.router didLoadAdForPlacementIdentifier: self.routerPlacementIdentifier];
[IronSource loadISDemandOnlyInterstitialWithAdm: instanceID adm: bidResponse];
}
else
{
[IronSource loadISDemandOnlyInterstitial: instanceID];
if ( [IronSource hasISDemandOnlyInterstitial: instanceID] )
{
[self log: @"Ad is available already for instance ID: %@", instanceID];
[self.router didLoadAdForPlacementIdentifier: self.routerPlacementIdentifier];
}
else
{
[IronSource loadISDemandOnlyInterstitial: instanceID];
}
}
}

Expand Down Expand Up @@ -162,8 +183,10 @@ - (void)showInterstitialAdForParameters:(id<MAAdapterResponseParameters>)paramet

- (void)loadRewardedAdForParameters:(id<MAAdapterResponseParameters>)parameters andNotify:(id<MARewardedAdapterDelegate>)delegate
{
NSString *bidResponse = parameters.bidResponse;
BOOL isBiddingAd = [bidResponse al_isValidString];
NSString *instanceID = parameters.thirdPartyAdPlacementIdentifier;
[self log: @"Loading ironSource rewarded for instance ID: %@", instanceID];
[self log: @"Loading ironSource %@rewarded for instance ID: %@", ( isBiddingAd ? @"bidding " : @"" ), instanceID];

[self updateIronSourceDelegates];
[self setPrivacySettingsWithParameters: parameters];
Expand All @@ -172,14 +195,21 @@ - (void)loadRewardedAdForParameters:(id<MAAdapterResponseParameters>)parameters
self.routerPlacementIdentifier = [ALIronSourceMediationAdapterRouter rewardedVideoRouterIdentifierForInstanceID: instanceID];
[self.router addRewardedAdapter: self delegate: delegate forPlacementIdentifier: self.routerPlacementIdentifier];

if ( [IronSource hasISDemandOnlyRewardedVideo: instanceID] )
if ( isBiddingAd )
{
[self log: @"Ad is available already for instance ID: %@", instanceID];
[self.router didLoadAdForPlacementIdentifier: self.routerPlacementIdentifier];
[IronSource loadISDemandOnlyRewardedVideoWithAdm: instanceID adm: bidResponse];
}
else
{
[IronSource loadISDemandOnlyRewardedVideo: instanceID];
if ( [IronSource hasISDemandOnlyRewardedVideo: instanceID] )
{
[self log: @"Ad is available already for instance ID: %@", instanceID];
[self.router didLoadAdForPlacementIdentifier: self.routerPlacementIdentifier];
}
else
{
[IronSource loadISDemandOnlyRewardedVideo: instanceID];
}
}
}

Expand Down Expand Up @@ -227,8 +257,10 @@ - (void)showRewardedAdForParameters:(id<MAAdapterResponseParameters>)parameters

- (void)loadAdViewAdForParameters:(id<MAAdapterResponseParameters>)parameters adFormat:(MAAdFormat *)adFormat andNotify:(id<MAAdViewAdapterDelegate>)delegate
{
NSString *bidResponse = parameters.bidResponse;
BOOL isBiddingAd = [bidResponse al_isValidString];
NSString *instanceID = parameters.thirdPartyAdPlacementIdentifier;
[self log: @"Loading %@ ad for instance ID: %@", adFormat.label, instanceID];
[self log: @"Loading %@%@ ad for instance ID: %@", ( isBiddingAd ? @"bidding " : @"" ), adFormat.label, instanceID];

self.adViewAdapterDelegate = [[ALIronSourceMediationAdapterAdViewDelegate alloc] initWithParentAdapter: self andNotify: delegate];
[IronSource setISDemandOnlyBannerDelegate: self.adViewAdapterDelegate forInstanceId: instanceID];
Expand All @@ -240,7 +272,19 @@ - (void)loadAdViewAdForParameters:(id<MAAdapterResponseParameters>)parameters ad
presentingViewController = [ALUtils topViewControllerFromKeyWindow];
});

[IronSource loadISDemandOnlyBannerWithInstanceId: instanceID viewController: presentingViewController size: [self toISBannerSize: adFormat]];
if ( isBiddingAd )
{
[IronSource loadISDemandOnlyBannerWithAdm: bidResponse
instanceId: instanceID
viewController: presentingViewController
size: [self toISBannerSize: adFormat]];
}
else
{
[IronSource loadISDemandOnlyBannerWithInstanceId: instanceID
viewController: presentingViewController
size: [self toISBannerSize: adFormat]];
}
}

#pragma mark - Dynamic Properties
Expand Down

0 comments on commit 177c6b6

Please sign in to comment.