Search in sources :

Example 6 with InteractionListener

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

the class MyTargetMopubCustomEventBanner method onClick.

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

Example 7 with InteractionListener

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

the class MyTargetMopubCustomEventBanner method onNoAd.

@Override
public void onNoAd(@NonNull String reason, @NonNull MyTargetView myTargetView) {
    MoPubLog.log(getAdNetworkId(), CUSTOM, ADAPTER_NAME, "myTarget banner ad failed to load.");
    MoPubErrorCode code = NETWORK_NO_FILL;
    MoPubLog.log(getAdNetworkId(), 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 : MoPubErrorCode(com.mopub.mobileads.MoPubErrorCode) InteractionListener(com.mopub.mobileads.AdLifecycleListener.InteractionListener) LoadListener(com.mopub.mobileads.AdLifecycleListener.LoadListener)

Example 8 with InteractionListener

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

the class MyTargetMopubCustomEventInterstitial method onClick.

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

Example 9 with InteractionListener

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

the class MyTargetMopubCustomEventRewardedVideo method onDisplay.

@Override
public void onDisplay(@NonNull RewardedAd 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 10 with InteractionListener

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

the class MyTargetMopubCustomEventRewardedVideo method onReward.

@Override
public void onReward(@NonNull Reward reward, @NonNull RewardedAd ad) {
    MoPubLog.log(AdLogEvent.CUSTOM, ADAPTER_NAME, "Rewarded");
    InteractionListener interactionListener = mInteractionListener;
    if (interactionListener != null) {
        interactionListener.onAdComplete(MoPubReward.success(reward.type, MoPubReward.NO_REWARD_AMOUNT));
    }
}
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