Search in sources :

Example 1 with OguryInterstitialAd

use of com.ogury.ed.OguryInterstitialAd in project mopub-android-mediation by mopub.

the class OguryInterstitial 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();
    mAdUnitId = OguryAdapterConfiguration.getAdUnitId(extras);
    if (TextUtils.isEmpty(mAdUnitId)) {
        MoPubLog.log(getAdNetworkId(), CUSTOM, ADAPTER_NAME, "Received invalid Ogury ad " + "unit ID for interstitial. 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);
    mListenerHelper = new OguryAdListenerHelper(ADAPTER_NAME, mAdUnitId);
    mListenerHelper.setLoadListener(mLoadListener);
    mInterstitial = new OguryInterstitialAd(context, mAdUnitId);
    mInterstitial.setListener(this);
    mInterstitial.setAdImpressionListener(this);
    mInterstitial.load();
    MoPubLog.log(getAdNetworkId(), LOAD_ATTEMPTED, ADAPTER_NAME);
}
Also used : PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager) OguryInterstitialAd(com.ogury.ed.OguryInterstitialAd)

Aggregations

PersonalInfoManager (com.mopub.common.privacy.PersonalInfoManager)1 OguryInterstitialAd (com.ogury.ed.OguryInterstitialAd)1