Search in sources :

Example 6 with InterstitialAd

use of com.my.target.ads.InterstitialAd in project mytarget-android by myTargetSDK.

the class MyTargetMopubCustomEventRewardedVideo method checkAndInitializeSdk.

@Override
protected boolean checkAndInitializeSdk(@NonNull Activity launcherActivity, @NonNull Map<String, Object> localExtras, @NonNull Map<String, String> serverExtras) throws Exception {
    int slotId = 0;
    if (serverExtras.size() == 0 || !serverExtras.containsKey(SLOT_ID_KEY)) {
        Log.i(TAG, "Unable to get slotId from parameter json. Probably Admob mediation " + "misconfiguration.");
        return false;
    }
    try {
        slotId = Integer.parseInt(serverExtras.get(SLOT_ID_KEY));
    } catch (NumberFormatException e) {
        Log.d(TAG, "Wrong slotId");
        return false;
    }
    ad = new InterstitialAd(slotId, launcherActivity);
    MopubCustomParamsUtils.fillCustomParams(ad.getCustomParams(), localExtras);
    ad.setListener(new RewardedListener());
    return true;
}
Also used : InterstitialAd(com.my.target.ads.InterstitialAd)

Aggregations

InterstitialAd (com.my.target.ads.InterstitialAd)6 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 LoadListener (com.mopub.mobileads.AdLifecycleListener.LoadListener)1 InterstitialAdListener (com.my.target.ads.InterstitialAd.InterstitialAdListener)1 AdvertisingType (com.my.targetDemoApp.models.AdvertisingType)1