use of com.ogury.ed.OguryBannerAdSize in project mopub-android-mediation by mopub.
the class OguryBanner method load.
@Override
protected void load(@NonNull Context context, @NonNull AdData adData) {
Preconditions.checkNotNull(context);
Preconditions.checkNotNull(adData);
final PersonalInfoManager personalInfoManager = MoPub.getPersonalInformationManager();
if (personalInfoManager != null) {
final boolean consentIsUnknown = personalInfoManager.getPersonalInfoConsentStatus() == ConsentStatus.UNKNOWN;
final boolean canCollectPersonalInfo = MoPub.canCollectPersonalInformation();
if (OguryAdapterConfiguration.initialized() && !consentIsUnknown) {
OguryChoiceManagerExternal.setConsent(canCollectPersonalInfo, OguryAdapterConfiguration.CHOICE_MANAGER_CONSENT_ORIGIN);
}
}
setAutomaticImpressionAndClickTracking(false);
final Map<String, String> extras = adData.getExtras();
final OguryBannerAdSize adSize = getBannerAdSize(adData.getAdWidth(), adData.getAdHeight());
mAdUnitId = OguryAdapterConfiguration.getAdUnitId(extras);
if (TextUtils.isEmpty(mAdUnitId) || adSize == null) {
if (adSize == null) {
MoPubLog.log(CUSTOM, ADAPTER_NAME, "The requested banner size does not fit " + "because Ogury only supports 320x50 and 300x250 sizes. Failing ad request.");
}
MoPubLog.log(getAdNetworkId(), LOAD_FAILED, ADAPTER_NAME, MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR.getIntCode(), MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
if (mLoadListener != null) {
mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
}
return;
}
mOguryAdapterConfiguration.setCachedInitializationParameters(context, extras);
mBanner = new OguryBannerAdView(context);
mBanner.setAdUnit(mAdUnitId);
mBanner.setAdSize(adSize);
mListenerHelper = new OguryAdListenerHelper(ADAPTER_NAME, mAdUnitId);
mListenerHelper.setLoadListener(mLoadListener);
mBanner.setListener(this);
mBanner.setAdImpressionListener(this);
mBanner.loadAd();
MoPubLog.log(getAdNetworkId(), LOAD_ATTEMPTED, ADAPTER_NAME);
}
Aggregations