Search in sources :

Example 1 with InteractionListener

use of com.mopub.mobileads.AdLifecycleListener.InteractionListener in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventInterstitial method onNoAd.

@Override
public void onNoAd(@NonNull String reason, @NonNull InterstitialAd ad) {
    MoPubLog.log(getAdNetworkId(), CUSTOM, ADAPTER_NAME, "myTarget banner ad failed " + "to load.");
    MoPubErrorCode code = NETWORK_NO_FILL;
    MoPubLog.log(getAdNetworkId(), AdLogEvent.LOAD_FAILED, ADAPTER_NAME, code.getIntCode(), code);
    LoadListener loadListener = mLoadListener;
    InteractionListener interactionListener = mInteractionListener;
    if (interactionListener == null && loadListener != null) {
        loadListener.onAdLoadFailed(code);
    } else if (interactionListener != null) {
        interactionListener.onAdFailed(code);
    }
}
Also used : InteractionListener(com.mopub.mobileads.AdLifecycleListener.InteractionListener) LoadListener(com.mopub.mobileads.AdLifecycleListener.LoadListener)

Example 2 with InteractionListener

use of com.mopub.mobileads.AdLifecycleListener.InteractionListener in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventInterstitial method onDisplay.

@Override
public void onDisplay(@NonNull InterstitialAd ad) {
    MoPubLog.log(getAdNetworkId(), SHOW_SUCCESS, ADAPTER_NAME);
    InteractionListener interactionListener = mInteractionListener;
    if (interactionListener != null) {
        interactionListener.onAdShown();
        interactionListener.onAdImpression();
    }
}
Also used : InteractionListener(com.mopub.mobileads.AdLifecycleListener.InteractionListener)

Example 3 with InteractionListener

use of com.mopub.mobileads.AdLifecycleListener.InteractionListener in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventRewardedVideo method onClick.

@Override
public void onClick(@NonNull RewardedAd ad) {
    MoPubLog.log(getAdNetworkId(), CLICKED, ADAPTER_NAME);
    InteractionListener interactionListener = mInteractionListener;
    if (interactionListener != null) {
        interactionListener.onAdClicked();
    }
}
Also used : InteractionListener(com.mopub.mobileads.AdLifecycleListener.InteractionListener)

Example 4 with InteractionListener

use of com.mopub.mobileads.AdLifecycleListener.InteractionListener in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventRewardedVideo method onNoAd.

@Override
public void onNoAd(@NonNull String reason, @NonNull RewardedAd ad) {
    MoPubLog.log(getAdNetworkId(), CUSTOM, ADAPTER_NAME, "myTarget banner ad failed " + "to load.");
    MoPubErrorCode code = NETWORK_NO_FILL;
    MoPubLog.log(getAdNetworkId(), AdLogEvent.LOAD_FAILED, ADAPTER_NAME, code.getIntCode(), code);
    InteractionListener interactionListener = mInteractionListener;
    LoadListener loadListener = mLoadListener;
    if (interactionListener == null && loadListener != null) {
        loadListener.onAdLoadFailed(code);
    } else if (interactionListener != null) {
        interactionListener.onAdFailed(code);
    }
}
Also used : InteractionListener(com.mopub.mobileads.AdLifecycleListener.InteractionListener) LoadListener(com.mopub.mobileads.AdLifecycleListener.LoadListener)

Example 5 with InteractionListener

use of com.mopub.mobileads.AdLifecycleListener.InteractionListener in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventBanner method onShow.

@Override
public void onShow(@NonNull final MyTargetView myTargetView) {
    MoPubLog.log(getAdNetworkId(), CUSTOM, ADAPTER_NAME, "myTarget banner ad onShow");
    InteractionListener interactionListener = mInteractionListener;
    if (interactionListener != null) {
        interactionListener.onAdImpression();
    }
}
Also used : InteractionListener(com.mopub.mobileads.AdLifecycleListener.InteractionListener)

Aggregations

InteractionListener (com.mopub.mobileads.AdLifecycleListener.InteractionListener)10 LoadListener (com.mopub.mobileads.AdLifecycleListener.LoadListener)3 MoPubErrorCode (com.mopub.mobileads.MoPubErrorCode)1