Search in sources :

Example 1 with OguryOptinVideoAd

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

the class OguryRewardedVideo 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 rewarded ad. 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);
    mOptInVideo = new OguryOptinVideoAd(context, mAdUnitId);
    mOptInVideo.setListener(this);
    mOptInVideo.setAdImpressionListener(this);
    mOptInVideo.load();
    MoPubLog.log(getAdNetworkId(), LOAD_ATTEMPTED, ADAPTER_NAME);
}
Also used : PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager) OguryOptinVideoAd(com.ogury.ed.OguryOptinVideoAd)

Aggregations

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