googleads / googleads-mobile-android-mediation

Sample Android project showcasing how to build a mediation adapter or custom event for the Google Mobile Ads SDK.
Apache License 2.0
241 stars 197 forks source link

Update IronSource Adapter to the new architecture and added Banner #483

Closed alon357 closed 12 months ago

alon357 commented 1 year ago

hi @joshuajplagonera I wanted to share the latest PR we have decided to refactor the adapter according to the notes you have shared. We even took extra measures to clean up and fix legacy issues.

Overall, the adapter architecture is as follows: IronSourceAdapter and IronSourceRewardedAdapter extend IronSourceMediationAdapter. IronSourceMediationAdapter extends Adapter and is in charge of SDK Initialization and the different load functions. We have created new classes for each ad format: IronSourceBannerAd, IronSourceInterstitialAd, and IronSourceRewardedAd. Each class contains the ad format-specific functionality. Each of the above classes contains a static instance of either IronSourceBannerAdListener, IronSourceInterstitialAdListener or IronSourceRewardedAdListener. These handle the SDK callbacks for the respective ad format. We decided to remove the use of WeakAdapters as it caused GC issues in the new design. We have removed the IronSourceManager class and split its functionality between the different ad format classes. We have created a new IronSourceRewardItem class, which is used by the IronSourceRewardedAd class on the reward callback.

I think this integration is much clearer and more organized. Included here is a UML overview that displays the architecture.