I dont know itz fully corect or not…
So any 1 want to create this extension.
// IronSourceAdapter.java
import com.applovin.mediation.MaxAdapter;
import com.applovin.mediation.bidding.MaxBidding.Bidder;
import com.applovin.mediation.bidding.MaxBidding.BidderData;
import com.applovin.mediation.bidding.MaxBidding.BiddingResult;
import com.applovin.mediation.bidding.MaxBidding.BiddingResultListener;
import com.ironsource.mediationsdk.IronSource;
import com.ironsource.mediationsdk.ISDemandOnlyListener;
import com.ironsource.mediationsdk.IronSource.AD_UNIT;
import com.ironsource.mediationsdk.IronSource.AD_PLACEMENT;
import com.ironsource.mediationsdk.IronSource.AD_UNIT_TYPE;
import com.ironsource.mediationsdk.IronSource.AD_PLACEMENT_TYPE;
import com.ironsource.mediationsdk.IronSource.Placement;
import com.ironsource.mediationsdk.sdk.InterstitialListener;
import com.ironsource.mediationsdk.sdk.RewardedVideoListener;
public class IronSourceAdapter implements MaxAdapter, InterstitialListener, RewardedVideoListener, ISDemandOnlyListener {
// ... Your IronSource App Key and Placement IDs
// Initialize IronSource SDK
@Override
public void initialize(String userId) {
IronSource.setDemandOnlyListener(this);
IronSource.init(IRON_SOURCE_APP_KEY, IronSource.AD_UNIT.INTERSTITIAL);
IronSource.setRewardedVideoListener(this);
}
// Bidder Implementation
public static class IronSourceBidder implements Bidder {
@Override
public void getBid(BidderData bidderData, BiddingResultListener resultListener) {
IronSource.getBiddingData(bidderData.adUnitId, bidderData.adFormat, bidderData.extras,
bidderData.adNetworkData, bidderData.userId, new ISDemandOnlyListener() {
@Override
public void onBiddingDataAvailable(String adUnit, String adFormat, String biddingData) {
// Parse bid data from IronSource and create BiddingResult
BiddingResult biddingResult = new BiddingResult(adUnit, adFormat, biddingData);
resultListener.onBiddingResultAvailable(biddingResult);
}
@Override
public void onBiddingDataFailed(String adUnit, String adFormat, String errorReason) {
// Log error and call result listener with failure
resultListener.onBiddingDataFailed(errorReason);
}
});
}
}
// Handle Ad Requests (Interstitial/Rewarded)
@Override
public void loadAd(String adUnitId, String adFormat, String userId, boolean isBidding, MaxAdListener adListener) {
// ... Load the ad from IronSource based on ad format
// ...
}
// ... (Implement InterstitialListener, RewardedVideoListener, ISDemandOnlyListener for ad loading, events, etc.)
}