Search in sources :

Example 31 with AdException

use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.

the class PrebidInterstitialAdapter method initInterstitialController.

private void initInterstitialController(Context context, String responseId) {
    try {
        mInterstitialController = new InterstitialController(context, mInterstitialListener);
        mInterstitialController.loadAd(responseId, false);
    } catch (AdException e) {
        MoPubLog.log(MoPubLog.AdapterLogEvent.LOAD_FAILED, TAG);
        mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
    }
}
Also used : InterstitialController(org.prebid.mobile.rendering.bidding.display.InterstitialController) AdException(org.prebid.mobile.rendering.errors.AdException)

Example 32 with AdException

use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.

the class InterstitialView method init.

@Override
protected void init() throws AdException {
    try {
        super.init();
        setAdViewManagerValues();
        registerEventBroadcast();
    } catch (Exception e) {
        throw new AdException(AdException.INIT_ERROR, "AdView initialization failed: " + Log.getStackTraceString(e));
    }
}
Also used : AdException(org.prebid.mobile.rendering.errors.AdException) AdException(org.prebid.mobile.rendering.errors.AdException)

Example 33 with AdException

use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.

the class InterstitialView method showVideoAsInterstitial.

public void showVideoAsInterstitial() {
    try {
        final AdConfiguration adConfiguration = mAdViewManager.getAdConfiguration();
        mInterstitialManager.configureInterstitialProperties(adConfiguration);
        mInterstitialVideo = new InterstitialVideo(getContext(), InterstitialView.this, mInterstitialManager, adConfiguration);
        mInterstitialVideo.setDialogListener(this::handleDialogEvent);
        mInterstitialVideo.show();
    } catch (final Exception e) {
        LogUtil.error(TAG, "Video interstitial failed to show:" + Log.getStackTraceString(e));
        notifyErrorListeners(new AdException(AdException.INTERNAL_ERROR, e.getMessage()));
    }
}
Also used : AdConfiguration(org.prebid.mobile.rendering.models.AdConfiguration) InterstitialVideo(org.prebid.mobile.rendering.views.interstitial.InterstitialVideo) AdException(org.prebid.mobile.rendering.errors.AdException) AdException(org.prebid.mobile.rendering.errors.AdException)

Example 34 with AdException

use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.

the class PrebidBannerAdapter method initDisplayView.

private void initDisplayView(Context context, String responseId) {
    try {
        AdConfiguration adUnitConfiguration = new AdConfiguration();
        adUnitConfiguration.setAdUnitIdentifierType(AdConfiguration.AdUnitIdentifierType.BANNER);
        mDisplayView = new DisplayView(context, mDisplayViewListener, adUnitConfiguration, responseId);
    } catch (AdException e) {
        MoPubLog.log(MoPubLog.AdapterLogEvent.LOAD_FAILED, TAG);
        mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
    }
}
Also used : AdConfiguration(org.prebid.mobile.rendering.models.AdConfiguration) DisplayView(org.prebid.mobile.rendering.bidding.display.DisplayView) AdException(org.prebid.mobile.rendering.errors.AdException)

Example 35 with AdException

use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.

the class PrebidRewardedVideoAdapter method initInterstitialController.

private void initInterstitialController(Context context, String responseId) {
    try {
        mInterstitialController = new InterstitialController(context, mInterstitialListener);
        mInterstitialController.loadAd(responseId, true);
    } catch (AdException e) {
        MoPubLog.log(MoPubLog.AdapterLogEvent.LOAD_FAILED, TAG);
        mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
    }
}
Also used : InterstitialController(org.prebid.mobile.rendering.bidding.display.InterstitialController) AdException(org.prebid.mobile.rendering.errors.AdException)

Aggregations

AdException (org.prebid.mobile.rendering.errors.AdException)54 Test (org.junit.Test)25 InterstitialController (org.prebid.mobile.rendering.bidding.display.InterstitialController)7 AdConfiguration (org.prebid.mobile.rendering.models.AdConfiguration)6 AdError (com.google.android.gms.ads.AdError)5 BidResponse (org.prebid.mobile.rendering.bidding.data.bid.BidResponse)5 Bid (org.prebid.mobile.rendering.bidding.data.bid.Bid)4 InterstitialControllerListener (org.prebid.mobile.rendering.bidding.interfaces.InterstitialControllerListener)4 CreativeModel (org.prebid.mobile.rendering.models.CreativeModel)4 InterstitialManager (org.prebid.mobile.rendering.views.interstitial.InterstitialManager)4 Context (android.content.Context)2 Bundle (android.os.Bundle)2 NonNull (androidx.annotation.NonNull)2 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 InterstitialView (org.prebid.mobile.rendering.bidding.display.InterstitialView)2 BannerEventListener (org.prebid.mobile.rendering.bidding.listeners.BannerEventListener)2 InterstitialEventListener (org.prebid.mobile.rendering.bidding.listeners.InterstitialEventListener)2 RewardedVideoEventListener (org.prebid.mobile.rendering.bidding.listeners.RewardedVideoEventListener)2 VastExtractorResult (org.prebid.mobile.rendering.models.internal.VastExtractorResult)2